Make request available to custom 500 and 400 templates
The problem occurs when rendering views.defaults.server_error
with template, which is using some request
- based markup. The request
variable in template is just empty
Change History
(5)
Easy pickings: |
set
|
Owner: |
changed from nobody to Andrew
|
Status: |
new → assigned
|
Component: |
Generic views → HTTP handling
|
Summary: |
Custom 500 page is broken → Make request available to custom 500 and 404 templates
|
Type: |
Uncategorized → New feature
|
Summary: |
Make request available to custom 500 and 404 templates → Make request available to custom 500 and 400 templates
|
Has patch: |
unset
|
Resolution: |
→ wontfix
|
Status: |
assigned → closed
|
Django deliberately doesn't pass a
request
objects when rendering 400 and 500 error pages. It's recommended to keep them as simple as possible and don't e.g. interact with the database (see #22011) or do anything that might cause further errors. You can always customize error views in your app and pass arequest
objects to templates, but my advise is to avoid it.You can also start a discussion on DevelopersMailingList if you don't agree.