Env. Variables not set while running Minimal Flask application

前端 未结 19 2194

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:13

    Did you run your terminal as administrator? I had the same problem, and running cmd/PowerShell as admin fixed it for me.

    Edit: I spoke too soon. Running as admin did nothing.

    The real answer (to my problem, at least) is a combination of some of the other answers.

    1. Instead of using set FLASK_APP = myApp.py, use setx FLASK_APP myApp.py
    2. Restart the terminal, and FLASK_APP will have the new value

提交回复
热议问题