django-pagination的文檔已過期1.4。跟蹤他們時,我沒有收到錯誤,但分頁不起作用。分頁頁面計數器加載,但沒有分頁。以下是我有:Django的Django分頁1.4
settings.py這裏:
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",)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'pagination.middleware.PaginationMiddleware',
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'photologue',
'pagination',
)
gallery_detail.html這裏:
{% extends "photologue/root.html" %}
{% load pagination_tags %}
{% block title %}{{ object.title }}{% endblock %}
{% block content %}
<h1>Gallery {{ object.title }}</h1>
<h2>Originally published {{ object.date_added|date:"l, F jS, Y" }}</h2>
{% if object.description %}<p>{{ object.description }}</p>{% endif %}
<div class="photo-gallery">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
{% autopaginate object.public 10 %}
{% for photo in object.public %}
<td><div class="gallery-photo">
<a href="{{ photo.get_absolute_url }}"><img src="{{ photo.get_thumbnail_url }}" alt="{{ photo.title }}"/></a>
</div></td>
</tr>
</table>
{% endfor %}
{% paginate %}
</div>
<p><a href="{% url pl-gallery-list 1 %}">View all galleries</a></p>
{% endblock %}
感謝您的幫助。
你認爲什麼是代碼? –