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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -