开发者

TemplateSyntaxError, Could not parse the remainder

开发者 https://www.devze.com 2023-03-31 07:31 出处:网络
I\'m following the django tutorial at Django by example in http://www.lightbird.net/. In the first example, TodoList, Customizing Model Template part, I\'ve copied the template to

I'm following the django tutorial at Django by example in http://www.lightbird.net/. In the first example, TodoList, Customizing Model Template part, I've copied the template to todo/item.

{% block content %}
<a href="{% url admin:todo_datetime_add %}">Add Todo items</a>

Above is what I add in the change_list.html as the website content said.

I want to reuse the admin/change_list.html and add a li开发者_开发技巧nk right after the block content line. But when I visit the url, I get the 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'

I just wonder what should I do to use the 'admin:' namespaces in the template. Do I need to add something in the urls.py file? Thanks.


I had to put quotes around the url.

changed: admin:todo_datetime_add

to: 'admin:todo_datetime_add'

0

精彩评论

暂无评论...
验证码 换一张
取 消