Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#32998 closed Bug (invalid)

process_view() is not called on 404

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

Description

I have middleware implemented using process_view(), which don’t get called when the 404 view runs in DEBUG=False.

Attachments (1)

process_view-error.zip (2.0 KB) - added by jooadam 4 months ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 4 months ago by Mariusz Felisiak

Component: UncategorizedHTTP handling
Resolution: needsinfo
Status: newclosed

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.

Changed 4 months ago by jooadam

Attachment: process_view-error.zip added

comment:2 Changed 4 months ago by jooadam

Resolution: needsinfo
Status: closednew

See the attachment.

comment:3 Changed 4 months ago by Carlton Gibson

Resolution: invalid
Status: newclosed

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.

comment:4 in reply to:  3 Changed 4 months ago by jooadam

Replying to 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.

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