Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TemplateSyntaxError, Could not parse the remainder

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 link 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.

like image 965
Ethan Avatar asked Aug 29 '11 16:08

Ethan


1 Answers

I had to put quotes around the url.

changed: admin:todo_datetime_add

to: 'admin:todo_datetime_add'

like image 153
user532954 Avatar answered Nov 14 '22 06:11

user532954