django-pagination配置出错处理
是否有人出现这类错误:
首先确认几个修改处:
setting.py添加
- INSTALLED_APPS = (
- # ...
- 'pagination',
- )
添加中间件
- MIDDLEWARE_CLASSES = (
- # ...
- 'pagination.middleware.PaginationMiddleware',
- )
- TEMPLATE_CONTEXT_PROCESSORS = (
- "django.core.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "django.core.context_processors.media",
- "django.core.context_processors.request"
- )
最后确认
from django.template import RequestContext
def test(request):
lists =User.objects.all()
return render_to_response('test.html',{'list':lists},context_instance = RequestContext(request))
视频教程:
http://eflorenzano.com/blog/2008/07/13/first-two-django-screencasts/