Weblog

Pretty template error pages

Thanks to Django ninja Robert Wittams and our resident design guru Wilson Miner, Django now has pretty error pages for template syntax errors.

You probably already know that Django displays pretty error pages for tracebacks if your DEBUG setting is set to True. We added this about a week ago.

Now, we've added a TEMPLATE_DEBUG setting. Set it to True, and the pretty error pages will display a relevant template snippet, with the offending line highlighted, for any TemplateSyntaxError.

Of course, note this change applies to the Django development version. It'll be rolled into 0.91 when that's released.

Posted by Adrian Holovaty on November 23, 2005

Comments

Simon Willison November 23, 2005 at 6:14 p.m.

We should add screenshots of stuff like this to the Django site.

radek November 24, 2005 at 2:38 a.m.

Simon is right. I am missing screenshots and explanation diagrams on the site and in the docs.

nirvdrum November 24, 2005 at 10:31 a.m.

Good stuff. I haven't tried it yet, but it sounds very similary to Tapestry's line-precise error reporting, which does make fixing template errors considerably faster.

Comments are closed

To prevent spam, comments are no longer allowed after sixty days.