Hi Django users,

We made at our company, City Live, a template tag you may be
interested in.
It's a try/catch statement. When anything in the try block fails, a
traceback through all the included templates is shown.

A good approach would be to include {% try %} ... {% endtry %} in the
base template of the whole site, so that any template rendering error
will be caught.

If you prefer a custom message instead of the traceback, the following
is also possible:
{% try %} ... {% except %} custom error message {% endtry %}


Screenshot of the traceback, embedded in our site:
http://github.com/citylive/Django-Template-Tags/blob/master/screenshots/traceback.png

Source:
http://github.com/citylive/Django-Template-Tags/blob/master/templatetags/debug.py

It depends on this {% stylize %} template tag and pygments for the
highlighting.
http://github.com/citylive/Django-Template-Tags/blob/master/templatetags/stylize.py

All feedback is welcome!

Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to