Re: [Django] #33702: Make request available to custom 500 and 400 templates

2 views
Skip to first unread message

Django

unread,
May 13, 2022, 12:24:56 AM5/13/22
to django-...@googlegroups.com
#33702: Make request available to custom 500 and 400 templates
-------------------------------+--------------------------------------
Reporter: Andrew | Owner: Andrew
Type: New feature | Status: closed
Component: HTTP handling | Version: 4.0
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* has_patch: 1 => 0
* resolution: => wontfix


Comment:

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
[https://docs.djangoproject.com/en/stable/topics/http/views/#customizing-
error-views-1 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33702#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages