Opened 7 years ago
Last modified 3 years 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: | Min ho Kim, Vibhu Agarwal | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Pull Requests: | How to create a pull request | ||
Description ¶
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).
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (5)
comment:1 by , 7 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 7 years ago
comment:3 by , 5 years ago
Hi Shai Berger,
Could you give some more information about this feature request?
It would be nice to have some example of error page you would like to see.
If anyone else has any idea what the expected error page should look like, please comment.
comment:4 by , 5 years ago
Cc: | added |
---|
comment:5 by , 5 years ago
Cc: | added |
---|
Shai,
Can you elaborate on what you mean? Are you suggesting we put the local context variables in a special section instead of with the rest of the local variables?