Changes between Initial Version and Version 1 of Ticket #29008, comment 2
- Timestamp:
- Jan 12, 2018, 2:39:22 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29008, comment 2
initial v1 1 1 The `technical_404_response` view performs a new URL resolving (cf https://github.com/django/django/blob/a8e492bc81fca829f5d270e2d57703c02e58701e/django/views/debug.py#L482) which will obviously raise a new `Http404` which won't be caught as only `Resolver404` is checked. That means the WSGI handler fails and the WSGI server returns the previously described default error message (indeed the error message is the default one from `wsgiref.handlers.BaseHandler` https://docs.python.org/3.6/library/wsgiref.html#wsgiref.handlers.BaseHandler.error_body). 2 2 3 The solution seems to be to catch `Http404` instead of `Resolver404` in `technical_404_response`. This will result in a technical 404 page with the `Http404`'s displayed and will match the behaviourwhen `DEBUG` is `False`.3 The solution seems to be to catch `Http404` instead of `Resolver404` in `technical_404_response`. This will result in a technical 404 page with the `Http404`'s message displayed and will match the behaviour of when `DEBUG` is `False`.