Opened 4 weeks ago

Last modified 4 weeks ago

#29446 new New feature

Include template context in error page when relevant

Reported by: Shai Berger Owned by:
Component: Error reporting Version: 2.0
Severity: Normal Keywords: template debug
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes


When an error is encountered while rendering a template (in Debug mode), Django helpfully displays the template source, followed by the usual stack-trace with local variable values. It could be useful to also include the template context at the point of the error, as these are often the relevant "local variables".

While the context is actually often available as a local variable in one of the function calls close to the bottom of the stack trace, it is not obvious, and requires a somewhat tedious search (there are usually a series of calls taking a context variable, most of them irrelevant).

Change History (1)

comment:1 Changed 4 weeks ago by Tim Graham

Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top