django-pagination配置出错处理

是否有人出现这类错误:

 

首先确认几个修改处:

setting.py添加

  1. INSTALLED_APPS = (  
  2.                 # ...  
  3.         'pagination',  
  4.             )  

 

添加中间件

  1. MIDDLEWARE_CLASSES = (  
  2.         # ...  
  3.             'pagination.middleware.PaginationMiddleware' 
  4.     )  

 

  1. TEMPLATE_CONTEXT_PROCESSORS = (  
  2.         "django.core.context_processors.auth",  
  3.         "django.core.context_processors.debug",  
  4.         "django.core.context_processors.i18n",  
  5.         "django.core.context_processors.media",  
  6.         "django.core.context_processors.request"  
  7.     )  

 

最后确认

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/

posted @ 2013-06-18 15:53  smallcoderhujin  阅读(372)  评论(0编辑  收藏  举报