[Django]-How to debug Jinja2 template?

16👍

After doing some more test, I found the answer :

By doing the same template test, directly under python, without using django, debug messages are present. So it comes from django.

The fix is in settings.py : One have to set DEBUG to True AND set TEMPLATE_DEBUG to False.

👤Eric

7👍

From the Jinja2 Documentation:

My tracebacks look weird. What’s happening?

If the speedups module is not compiled and you are using a Python installation without ctypes (Python 2.4 without ctypes, Jython or Google’s AppEngine) Jinja2 is unable to provide correct debugging information and the traceback may be incomplete. There is currently no good workaround for Jython or the AppEngine as ctypes is unavailable there and it’s not possible to use the speedups extension.

http://jinja.pocoo.org/2/documentation/faq#my-tracebacks-look-weird-what-s-happening

Leave a comment