我有运行1.3.1
版本的 django 代码,最近我将它更新到 django1.6.1
并清除了大部分错误,如direct_to_template
函数和一些settings
等,并且可以运行该站点。
{% 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>
那么谁能告诉我为什么会出现上述错误以及如何清除它?