Skip to content
Myr

debugging.txt

This file

Path

docs/src/debugging.txt

32 lines · 1.4 KiB

Last changed by

some more doc changes in jinja for the upcoming releaseArmin Ronacherbefore adoption825e522

History of this file

Take it

The walk stopped after 200 commits: lines older than 859efe0 point at it.

[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0

lines 1–10why, one step back
1===================
2Debugging Templates3===================45In order to keep templates debuggable you have to do some additional work on6the application side. The traceback module that comes with python currently7does not support the `__loader__` hook which is used by Jinja to provide8templates. Although the import system was implemented three Python versions9ago the default traceback system still doesn't support it.10

some more doc changes in jinja for the upcoming releaseArmin Ronacherbefore adoption825e522

lines 11–12why, one step back
11However most of the extended web development traceback modules have support
12for `__loader__`. Either directly or via the linecache module:

[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0

line 13why, one step back
13

some more doc changes in jinja for the upcoming releaseArmin Ronacherbefore adoption825e522

lines 14–15why, one step back
14- `Werkzeug Debugging Middleware`_
15- `Django`_

[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0

lines 16–21why, one step back
16- `cgitb`_
17- `EvalException`_1819To enable debugging you have to use one of those debugging systems or20implement your own one with support for `__loader__`.21

some more doc changes in jinja for the upcoming releaseArmin Ronacherbefore adoption825e522

lines 22–26why, one step back
22The python implementation of the jinja debugger can only translate the first
23exception in a traceback which can lead to problematic results. If you have24the extended debugger c extension compiled (default on unix systems but only25available on Windows if you have a VisualStudio 2003 installation) all frames26in the traceback will point to the correct linenumbers of the templates.

[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0

line 27why, one step back
27

some more doc changes in jinja for the upcoming releaseArmin Ronacherbefore adoption825e522

lines 28–30why, one step back
28
29.. _Werkzeug Debugging Middleware: http://werkzeug.pocoo.org/30.. _Django: http://www.djangoproject.com/

[svn] added ugly, ugly, ugly even more ugly but working hack to jinja to patch the template sources into linecache in order to support broken traceback formatters which go unnamed.Armin Ronacherbefore adoption859efe0

lines 31–32why, one step back
31.. _cgitb: http://docs.python.org/lib/module-cgitb.html
32.. _EvalException: http://pythonpaste.org/module-paste.evalexception.html