Flask Config File - 'DEBUG=True' Do Nothing Flask Config File - 'DEBUG=True' Do Nothing flask flask

Flask Config File - 'DEBUG=True' Do Nothing


Running with the debugger is different than setting the DEBUG config. You have to do both. Running the server in development mode sets the config automatically. Typically, you should rely on that rather than setting the config directly.

The "correct way to configure" you read about is a) just another way, not the "correct" way, and b) only sets the config, not the FLASK_ENV or FLASK_DEBUG environment variables, which is what controls the debug mode for the server.

Setting the environment variable FLASK_ENV=development tells flask run to wrap the application with the debugger and reloader. (app.run(debug=True) does the same but can't set FLASK_ENV, which only has an env var. The flask run command is preferred now). app.debug switches some internal behavior in the Flask app, such as passing through errors to the interactive debugger that development mode enabled.