How to run a flask application?

前端 未结 4 1134
傲寒
傲寒 2020-11-27 04:52

I want to know the correct way to start a flask application. The docs show two different commands:

$ flask -a sampl         


        
4条回答
  •  萌比男神i
    2020-11-27 05:09

    Latest documentation has the following example assuming you want to run hello.py(using .py file extension is optional):

    Unix, Linux, macOS, etc.:

    $ export FLASK_APP=hello
    $ flask run
    

    Windows:

    > set FLASK_APP=hello
    > flask run
    

提交回复
热议问题