问题
With django-extensions installed in your Django project, on a local machine you can use manage.py runserver_plus
to have the very useful Werkzeug debugger active, so that the 500 error page lets you poke around with your stack interactively.
How do you activate the Werkzeug-enabled 500 page when running from Heroku?
回答1:
If you are using gunicorn to serve your Django application on Heroku like on their tutorial https://devcenter.heroku.com/articles/django, you will not be able to see the Werkzeug debbuger because gunicorn does not use Werkzeug.
You have to serve you django application on Heroku using wsgi based server that uses Werkzeug like uWSGI. See -> https://github.com/unbit/uwsgi-docs/blob/master/tutorials/heroku_python.rst
Also DEBUG = True on your heroku settings must be set.
Having DEBUG = True on your production environment(heroku) is greatly discouraged because someone can view your settings(passwords) and even code.
来源:https://stackoverflow.com/questions/16069705/how-to-use-werkzeug-interactive-traceback-debugger-in-a-django-project-hosted-on