Search code examples
djangodebuggingpassengermod-wsgiwerkzeug

Debugging Django with Werkzeug under WSGI/Passenger - problems


I'm trying to use the werkzeug debugger, but despite installing it as recommended, I just get the normal django error page.

from my passenger_wsgi.py:

import django.core.handlers.wsgi
from werkzeug.debug import DebuggedApplication

application = django.core.handlers.wsgi.WSGIHandler()
application = DebuggedApplication(application, evalex=True)

I'm largely constrained to running my django app (even in development) through passenger, not manage.py.

Is there any way I can get the werkzeug debugger to work under these conditions? Could I, for instance prevent Django from intercepting the errors itself?


Solution

  • You can disable Django exception handling with DEBUG_PROPAGATE_EXCEPTIONS setting. Then Werkzeug will be able to handle it.