2014-01-29 81 views
0

我有1.3.1版本上運行Django的代碼,最近我更新它的Django 1.6.1和清除最喜歡direct_to_template功能和一些settings等的錯誤,並能能夠運行現場。異常值:請求」在Django

但對於一些網頁我得到下面的錯誤,當遇到模板{% autopaginate object_list 20 %}標籤

我使用django-pagination(1.0.7)我的分頁功能

Request Method: GET 
Request URL: http://localhost:8000/reports/safety/ 
Django Version: 1.6.1 
Exception Type: KeyError 
Exception Value:  
'request' 
Exception Location: /home/user/.virtualenvs/proj/local/lib/python2.7/site-packages/django/template/context.py in __getitem__, line 56 
Python Executable: /home/user/.virtualenvs/proj/bin/python 
Python Version: 2.7.4 
...... 
........ 


Error during template rendering 

In template /home/user/users/apps/proj/templates/shared/report.html, error at line 41 

request 

40 <tbody> 
41   {% autopaginate object_list 20 %} 
42   {% for report in object_list %} 
43    {{report}} 
44    ........ 
       ......... 
      {% endfor %} 
100 </tbody> 

所以,任何人都可以請讓我知道爲什麼它是得到上述錯誤以及如何清除它?

回答

1

啊,其實需要在TEMPLATE_CONTEXT_PROCESSORS設置中添加設置