Flask not activating debug mode Flask not activating debug mode flask flask

Flask not activating debug mode


I have tried the below steps and it worked for me.

Have added these lines of codes to my app.py file.

if __name__ == "__main__":    app.run(debug=True)

Then I ran the program from the Terminal using the command line

python3 app.py

and it worked.

Please find the below screenshot

enter image description here


Try This:

When you run,

export FLASK_APP=hello_world.py

Run this command after the above,

export FLASK_DEBUG=1

Finally,

flask run

I hope this would start the debug mode.


  • Make sure that you're running the right program, sometimes it happensthat we're making changes in some other program and running somethingelse.
  • Also ensure that Setting app.debug = True is altogether adifferent thing from setting FLASK_DEBUG mode to on.

Try this, this works at my end.

from flask import Flaskapp = Flask(__name__)@app.route('/')def hello_world():    return 'Hello World!'if __name__ == "__main__":    app.run(debug=True)