Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango-pagination issue with extends tag
    primarykey
    data
    text
    <p>I'm using django-pagination <a href="https://pypi.python.org/pypi/django-pagination" rel="nofollow">https://pypi.python.org/pypi/django-pagination</a> 1.0.7 package with Django 1.6. I have observed that my object_list are getting paginated properly when I does work fine ONLY when I do not use extends tag {% extends "base.html" %} </p> <p>Is django-pagination broken with latest Django or I'm missing something in configuration?</p> <p><strong>Project name:</strong> testing</p> <p><strong>settings.py</strong></p> <pre><code>INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'testing', 'pagination', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'pagination.middleware.PaginationMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.core.context_processors.request', 'django.contrib.messages.context_processors.messages', ) </code></pre> <p><strong>urls.py</strong></p> <pre><code>from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'testing.views.home', name='home'), url(r'^admin/', include(admin.site.urls)), ) </code></pre> <p><strong>views.py</strong></p> <pre><code>from django.shortcuts import render def home(request): return render(request, 'home.html', { 'numbers': range(100), }) </code></pre> <p><strong>base.html</strong></p> <pre><code>&lt;h1&gt;Hello World&lt;/h1&gt; {% block content%} {% endblock %} </code></pre> <p><strong>home.html</strong></p> <pre><code>{% comment %} {% extends "base.html" %} {% endcomment%} {% load pagination_tags %} {% autopaginate numbers 2 %} {% block content %} {% paginate %} &lt;ul&gt; {% for i in numbers %} &lt;li&gt;{{ i }}&lt;/li&gt; {% endfor %} &lt;/ul&gt; {% endblock %} </code></pre> <p>I do see proper pagination in this case on </p> <pre><code>http://127.0.0.1:1234 </code></pre> <p>but if I extends home.html from base.html by then pagination does not work.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload