This leads to - as shown in #2 - the clients getting more information than they should really care or know about.
Debugging is fine for development, but you shouldn't leave it on for production.
You could perhaps do something like: app.debug = bool(os.environ.get("FLASK_DEBUG", 0)) or something similar, so that you can run it as FLASK_DEBUG=1 python __main__.py, or how-ever you so desire.