【发布时间】:2014-07-06 20:04:40
【问题描述】:
我的 django 版本是 1.6.3
我从一个项目开始学习 django,该项目有这样的部分
#blog_list.html
<h3><a href="{% url detailblog blog.id %}">{{ blog.caption }}</a></h3>
#urls.py
url(r'^blog/(?P<id>\d+)/$', 'blog_show', name='detailblog'),
该过程是当我单击 blog_list 显示给我的列表中的一项时,它将通过 a 标签将我带到 blog_show。
但我收到错误消息:
'url' requires a non-empty first argument. The syntax changed in Django 1.5, see the docs.
我不知道这个答案在文档中的位置。
所以请帮帮我,告诉我这个问题的解决方案以及检查文档的正确方法,如果我遇到这种情况或更糟的情况。谢谢!
【问题讨论】:
-
我找到了解决方案。但是另一个错误出现了异常值:'str' object is not callable