【发布时间】:2011-07-11 13:07:48
【问题描述】:
url(r'^video/?$','stuff.abc.views.video',name="video"),
这不起作用:
<a href="{% url video %}">Videos</a>
但这有效:
<a href="/video">Videos</a>
错误是:
TemplateSyntaxError at /
Caught ViewDoesNotExist while rendering: Tried ad in module stuff.abc.views. Error was: 'module' object has no attribute 'ad'
【问题讨论】:
-
文件的其余部分说...?
-
哪个文件?模板,还是 urls.py?这是模板中唯一的东西。
-
是的,我得说这个错误看起来与你的 sn-p 无关。 sn-p 中没有提到“ad”,但您的错误消息抱怨“ad”不存在。看起来你正试图在查询字符串上传递一些东西——查看 Django 的文档以了解如何处理这个问题。
标签: python html django templates