开发者

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.handl开发者_开发技巧ers.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?


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


That's easy with the django-command-extensions. The runserver_plus command features werkzeug debugger.


This is because Django is intercepting any errors and converting them to an error page long before django.core.handlers.wsgi.WSGIHandler() returns anything. You will not be able to get it working that way as application errors within your Django site will never propagate all the way back up to the top level.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜