Opened 3 years ago

Closed 3 years ago

#33702 closed New feature (wontfix)

Make request available to custom 500 and 400 templates

Reported by: Andrew Owned by: Andrew
Component: HTTP handling Version: 4.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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)

comment:1 by Andrew, 3 years ago

Easy pickings: set
Owner: changed from nobody to Andrew
Status: newassigned

comment:2 by Andrew, 3 years ago

Has patch: set

comment:3 by Tim Graham, 3 years ago

Component: Generic viewsHTTP handling
Summary: Custom 500 page is brokenMake request available to custom 500 and 404 templates
Type: UncategorizedNew feature

comment:4 by Andrew, 3 years ago

Summary: Make request available to custom 500 and 404 templatesMake request available to custom 500 and 400 templates

comment:5 by Mariusz Felisiak, 3 years ago

Has patch: unset
Resolution: wontfix
Status: assignedclosed

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 a request objects to templates, but my advise is to avoid it.

You can also start a discussion on DevelopersMailingList if you don't agree.

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