How to setup environment variables for `flask run` on Windows?

前端 未结 14 1870
囚心锁ツ
囚心锁ツ 2021-02-04 10:19

I just started learning flask and I am stuck at setting up the Flask environment variables. I don\'t know how to setup the environment variables. Whenever I use the flask

相关标签:
14条回答
  • 2021-02-04 11:13

    Windows PowerShell

    set FLASK_APP=hello.py
    $env:FLASK_APP = "hello.py"
    flask run
    
    0 讨论(0)
  • 2021-02-04 11:16

    If you're using powershell, make sure you add quotations when setting the environment variable:

    $env:FLASK_APP = "app.py

    Then flask run should work.

    0 讨论(0)
提交回复
热议问题