Changes between Initial Version and Version 1 of Ticket #29008, comment 2


Ignore:
Timestamp:
01/12/2018 02:39:22 AM (4 months ago)
Author:
Antoine Humeau
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29008, comment 2

    initial v1  
    11The `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).
    22
    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 behaviour when `DEBUG` is `False`.
     3The 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`.
Back to Top