#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)
Change History (5)
comment:1 by , 3 years ago
Component: | Uncategorized → HTTP handling |
---|---|
Resolution: | → needsinfo |
Status: | new → closed |
by , 3 years ago
Attachment: | process_view-error.zip added |
---|
follow-up: 4 comment:3 by , 3 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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 by , 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.
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.