Why can't I use CLI to start Flask applications?

Python version 3.6
Flask version 0.12.2
tried to run a development server using Flask-CLi, but it was unsuccessful anyway.

clipboard.png

can be started in the following ways:

if __name__ == "__main__":
    app.run()
Mar.05,2021

the environment variable FLASK_APP was not found.

I remember that set in Powershell just defines a variable, not an environment variable.

try $env:FLASK_APP = "dispatch.py"

The correct way to write

is set FLASK_APP=dispatch.py
"=" with no spaces on either side

Menu