[Django] #32998: process_view() is not called on 404

16 views
Skip to first unread message

Django

unread,
Aug 6, 2021, 8:25:20 PM8/6/21
to django-...@googlegroups.com
#32998: process_view() is not called on 404
-----------------------------------------+------------------------
Reporter: jooadam | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
I have middleware implemented using process_view(), which don’t get called
when the 404 view runs in DEBUG=False.

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

Django

unread,
Aug 7, 2021, 3:00:10 PM8/7/21
to django-...@googlegroups.com
#32998: process_view() is not called on 404
-------------------------------+--------------------------------------
Reporter: jooadam | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 3.2
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => needsinfo
* component: Uncategorized => HTTP handling


Comment:

It works for me. Please reopen the ticket if you can debug your issue and
provide more details or a sample project. If you're having trouble
understanding how Django works, see
TicketClosingReasons/UseSupportChannels for ways to get help.

--
Ticket URL: <https://code.djangoproject.com/ticket/32998#comment:1>

Django

unread,
Aug 11, 2021, 8:40:03 AM8/11/21
to django-...@googlegroups.com
#32998: process_view() is not called on 404
-------------------------------+--------------------------------------
Reporter: jooadam | Owner: nobody

Type: Bug | Status: closed
Component: HTTP handling | Version: 3.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by jooadam):

* Attachment "process_view-error.zip" added.

Django

unread,
Aug 11, 2021, 8:41:05 AM8/11/21
to django-...@googlegroups.com
#32998: process_view() is not called on 404
-------------------------------+--------------------------------------

Reporter: jooadam | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by jooadam):

* status: closed => new
* resolution: needsinfo =>


Comment:

See the attachment.

--
Ticket URL: <https://code.djangoproject.com/ticket/32998#comment:2>

Django

unread,
Aug 11, 2021, 10:15:25 AM8/11/21
to django-...@googlegroups.com
#32998: process_view() is not called on 404
-------------------------------+--------------------------------------
Reporter: jooadam | Owner: nobody
Type: Bug | Status: closed

Component: HTTP handling | Version: 3.2
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* status: new => closed

* resolution: => invalid


Comment:

process_view() is run after the URL is resolved. (That's how the view
`callback` parameter is populated.) So, if resolution raises a 404,
process_view() will not be called. This is expected AFAICS.

--
Ticket URL: <https://code.djangoproject.com/ticket/32998#comment:3>

Django

unread,
Aug 11, 2021, 10:24:12 AM8/11/21
to django-...@googlegroups.com
#32998: process_view() is not called on 404
-------------------------------+--------------------------------------
Reporter: jooadam | Owner: nobody

Type: Bug | Status: closed
Component: HTTP handling | Version: 3.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by jooadam):

Replying to [comment:3 Carlton Gibson]:


> process_view() is run after the URL is resolved. (That's how the view
`callback` parameter is populated.) So, if resolution raises a 404,
process_view() will not be called. This is expected AFAICS.

I would definitely not expect this, or for that matter, to reference the
other issue I opened, that errors in a 404 not get logged. Django calls
error handlers views, so I would expect them to work the same way as
ordinary views, or call them something else. Or the very least, document
that they are exceptional.

--
Ticket URL: <https://code.djangoproject.com/ticket/32998#comment:4>

Reply all
Reply to author
Forward
0 new messages