Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Mariusz Felisiak, 3 years ago

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.

by jooadam, 3 years ago

Attachment: process_view-error.zip added

comment:2 by jooadam, 3 years ago

Resolution: needsinfo
Status: closednew

See the attachment.

comment:3 by Carlton Gibson, 3 years ago

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.

in reply to:  3 comment:4 by jooadam, 3 years ago

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