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

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

    The similar error was appearing when I was trying to run the application. I have to change the path. I changed directory to the folder where hello.py was saved.

    (venv) C:\Users\win10\flask-tutorial\myproject>cd venv
    (venv) C:\Users\win10\flask-tutorial\myproject\venv>set FLASK_APP=hello.py
    (venv) C:\Users\win10\flask-tutorial\myproject\venv>flask run
    

提交回复
热议问题