flask run
This one looks for an executable (called flask
) on your PATH, the first one executes with a parameter run
, which will make the flask helper run the application by calling FLASK_APP.
python -m flask run
This one looks for an executable called python
on your PATH, the first one executes receiving -m
as argument, which is supposed to run a module (flask) and then pass the parameter run to it.
The key difference here, is that as it executes the first found executable on PATH, you can run a totally different Flask from the first one. You can also run a different python version's Flask.
python app.py
This calls the first python
executable on PATH, and passes app.py
as argument. It will make python run the app.py script, which may or may not have app.run() (This is what starts Flask).
If you don't have anything inside app.py, it won't call Flask's server.