Werkzeug has a pretty decent error page with in-browser debugger and some other features. In just Django project it can be easily used with django-extensions with:
./manage.py runserver_plus
But we can't use this approach with gae, because it doesn't use runserver
, it
just works through wsgi.
So instead we should wrap our wsgi application with DebuggedApplication
.
So in wsgi.py
(or another file where wsgi
app defined) we need to change an app initialization to something like:
fromdjango.core.wsgiimportget_wsgi_applicationfromdjango.confimportsettingsfromwerkzeug.debugimportDebuggedApplicationapplication=get_wsgi_application()ifsettings.DEBUG:app=DebuggedApplication(app,True)# Werkzeug won't work without exceptions propagationsettings.DEBUG_PROPAGATE_EXCEPTIONS=True
And that's all.