0

i wonder why i'm start flask with flask run but alway debugmode off . when i'm using python app.py debug mode on. can explain me about run python app.py and flask run how different?

from flask import Flask, render_template
    
    app = Flask(__name__)
    
    
    @app.route("/")
    @app.route("/index")
    def index():
        return render_template("index.html")
    
    
    if __name__ == '__main__':
        app.run(debug=True, use_debugger=False, use_reloader=False)

this image when i'm start with flask run. enter image description here

and this image i'm using python app.py enter image description here

zark
  • 1
  • 1
  • Using `app.py` directly sets the program module name to [`__main__`](https://stackoverflow.com/questions/419163/what-does-if-name-main-do), while using `flask run` does not do that so the `app.run` line in the `if __name__ == '__main__':` block does not execute. – metatoaster May 09 '23 at 02:37

0 Answers0