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

前端 未结 14 1879
囚心锁ツ
囚心锁ツ 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:02

    The set command works but to setup the environment, you need to make sure that you are in the right directory where the file is located. For example, if my application is hello_world.py and it is located at the venv\hello\hello_world.py, you need to make sure that you are in the right directory before setting up set FLASK_APP=hello_world.py this is for windows but in another OS, you need to use export instead set

    (venv) C:\Users\myProjects\venv\hello\set FLASK_APP=hello_world.py

提交回复
热议问题