Reputation: 49816
I have a template which does not parse - instead django raises:
TemplateSyntaxError: Could not parse the remainder: '"{%' from '"{%'
Unfortunately, Django does not disclose where the error is. Is there a tool that can disclose the location of syntax errors in Django templates?
Upvotes: 3
Views: 1168
Reputation: 6323
Interactive debugger in django-extensions runserver_plus
command will make it easier to introspect template node content and template source, as well as look into context variables.
Other than that, be sure that templatetag is importable and do not raise an errors.
Unfortunately, I do not any easier way than that.
Upvotes: 2
Reputation: 23871
Good question,you could check error traceback again:
For example, template which looks like
{% block foo %}{{ "{% }}
raises a error tracestack, the 'nodelist' inside the last but two item could be
nodelist []
Which means the error is around the first child-node of the block foo.
Upvotes: 2
Reputation: 871
Don't think it tells you the exact location but Django Debug Toolbar should help here to some extent.
https://github.com/django-debug-toolbar/django-debug-toolbar
a tour http://vimeo.com/6640136
Upvotes: 0