Env. Variables not set while running Minimal Flask application

前端 未结 19 2007

I am trying to follow the flask documentation on my windows machine given at the following link: http://flask.pocoo.org/docs/0.11/quickstart/#debug-mode

Firstly I wrote

19条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 04:03

    Different shell programs have different ways to set the environment variable in it. So that Flask can discover you application correctly.

    • Unix Bash/Zsh (Linux, Mac, etc.):

      $ export FLASK_APP=hello
      $ flask run
      
    • Windows CMD:

      > set FLASK_APP=hello
      > flask run
      
    • Windows PowerShell:

      > $env:FLASK_APP = "hello"
      > flask run
      

    You can find more infomation in the Flask docs.

提交回复
热议问题