【发布时间】:2012-08-23 05:45:47
【问题描述】:
我收到这个由 URL 模板标签引起的错误:
在模板 C:\Users\Don't Panic\BitNami DjangoStack projects\Templates\polls\index.html 中,第 5 行出错
我真的不知道为什么会这样。我尝试删除该行,它工作正常,所以我认为这是唯一造成问题的行。
(顺便说一句,我在 Django 1.4.1 中)
此外,我已经尝试删除引号并删除第一行以及它们的所有组合。帮帮我?
1 {% load url from future %}
2 {% if latest_poll_list %}
3 <ul>
4 {% for poll in latest_poll_list %}
5 <li><a href="{% url 'polls.views.detail' poll.id %}">{{ poll.question }}</a></li>
6 {% endfor %}
7 </ul>
8 {% else %}
9 <p>No polls are available</p>
10 {% endif %}
【问题讨论】:
-
始终发布完整的堆栈跟踪。