Flask application can be run in following ways:
-
flask runcommand will look forapp.pyfile in the current directory and use it to run the flask app -
If you want to run flask but you don't want to name the file as
app.py, you need to set and environment variableFLASK_APPto specify the file name to run flask app.export FLASK_APP=app_two.py flask runYou can set
FLASK_APPvariable per command basis instead of setting it in environmentFLASK_APP=app_two.py flask run -
In order to run the flask application using python you can user the command below
python app_three.py