【发布时间】:2011-11-06 04:18:05
【问题描述】:
我正在通过http://www.lightbird.net/ 中的示例在 Django 中学习 django 教程。 在第一个示例中,TodoList,自定义模型模板部分,我已将模板复制到 待办事项/项目。
{% block content %}
<a href="{% url admin:todo_datetime_add %}">Add Todo items</a>
如网站内容所说,以上是我在change_list.html中添加的内容。
我想重用 admin/change_list.html 并在块内容行之后添加一个链接。 但是当我访问 url 时,我得到了 TemplateSyntaxError:
Template error
In template /pathtomyworkspace/TodoList/TodoList/templates/admin/todo/item/change_list.html, error at line 58
Could not parse the remainder: ':todo_datetime_add' from 'admin:todo_datetime_add'
我只是想知道我应该怎么做才能在模板中使用“admin:”命名空间。 我需要在 urls.py 文件中添加一些内容吗? 谢谢。
【问题讨论】:
标签: django-admin django-templates