Debugging Django with Werkzeug with WSGI / Passenger - Problems

I am trying to use the werkzeug debugger, but despite installing it as recommended, I just get the usual 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 basically have to run my django application (even in development) through the passenger, not manage.py.

Is there a way to make the werkzeug debugger work under these conditions? Could I, for example, prevent Django from catching the errors themselves?

+4
source share
3 answers

You can turn off Django exception handling with the setting DEBUG_PROPAGATE_EXCEPTIONS. Then Werkzeug will be able to handle this.

+7
source

It is easy with django-command-extensions . The runserver_plus command contains the werkzeug debugger.

+2
source

This is because Django intercepts any errors and translates them to the error page long before django.core.handlers.wsgi.WSGIHandler () returns anything. You will not be able to get it to work this way, because application errors on your Django site will never propagate fully to the top level.

+1
source

All Articles