#688 closed defect (fixed)
[patch] Error handlers lack context.
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Translations | Version: | 0.90 |
Severity: | critical | Keywords: | errors handlers 404 500 |
Cc: | django@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Which isn't nice because often one sets various extra_context variables for the views in the middleware. And the 404 view could be using a template which requires some variables from the context (for example name of the currently logged in user).
So it would be nice if page_not_found in django/views/defaults would pass the extra_context variables when rendering the 404.html template.
Attachments (1)
Change History (19)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Marking as invalid (see my previous comment).
comment:3 Changed 17 years ago by
Cc: | django@… added |
---|---|
Keywords: | errors handlers 404 500 added |
Resolution: | invalid |
Status: | closed → reopened |
Type: | defect → enhancement |
Yep it's possible, you just need to change the context of the view to a RequestContext. Here's a patch, or you can write your own custom view.
Changed 17 years ago by
Attachment: | error-handlers.diff added |
---|
Allows error handlers to benefit from context processors
comment:4 Changed 17 years ago by
Summary: | Default 404 handler uses no context. → [patch] Error handlers lack context |
---|
comment:5 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:6 Changed 17 years ago by
Component: | Core framework → Translations |
---|---|
priority: | normal → highest |
Severity: | normal → critical |
Type: | enhancement → task |
Version: | → 0.9 |
comment:8 Changed 16 years ago by
Summary: | [patch] Error handlers lack context → smart+question |
---|---|
Type: | task → defect |
preved
comment:18 Changed 16 years ago by
Summary: | smart+question → [patch] Error handlers lack context. |
---|
fixing spammed summary
Where would
page_not_found
get theextra_content
? I'm not sure this is possible...