Flask / Werkzeug run_simple not displaying Exception traces -
i created 2 flask apps: frontend , restapi (with flask-restful). created following runserver.py run them in development:
from werkzeug.wsgi import dispatchermiddleware werkzeug.serving import run_simple restapi import app restapi_app frontend import app frontend_app application = dispatchermiddleware(frontend_app, { '/api': restapi_app, }) if __name__ == "__main__": run_simple( 'localhost', 5000, application, use_reloader=true, use_debugger=true, use_evalex=true)
despite having use_debugger=true, whenever 1 of flask-restful resources raises error, don't trace, 500 error
{"status": 500, "message": "internal server error"}
any ideas how full trace display? let me know if need more details/code.
use_debugger
option of werkzeug wsgi server enables embedded debugger, server unaware of flask app configuration values (debug
in case). propagate exceptions server, need enable debug mode both flask app objects yourself. here's 1 way it:
if __name__ == '__main__': restapi_app.debug = true frontend_app.debug = true run_simple(...)
Comments
Post a Comment