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

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

    you need to provide an application environment. So Flask needs to know, the .py file to run. Try to run that command

    export FLASK_APP=application.py
    

    where application.py - name of your Flask app in my case it is application.py.

    after that

    flask run
    

提交回复
热议问题