Last active
February 10, 2018 17:39
-
-
Save probonopd/8616a8ff05c8a75e4601 to your computer and use it in GitHub Desktop.
Show flask traceback when running on production server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
@app.errorhandler(500) | |
def internal_error(exception): | |
"""Show traceback in the browser when running a flask app on a production server. | |
By default, flask does not show any useful information when running on a production server. | |
By adding this view, we output the Python traceback to the error 500 page. | |
""" | |
trace = traceback.format_exc() | |
return("<pre>" + trace + "</pre>"), 500 |
Confirmed, doesn't work here either
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't work.