0
votes

I want to automatically import my FLASK_APP environment variable when running the Windows cmd.

I installed the python-dotenv, then created an .env file under my project main path. However, I kept getting errors saying " Could not locate Flask application. You did not provide the FLASK_APP environment variable."

The following is the path I have for my project project Path

And my .env is saved under the same path "Flask Virtue Environment\env\Voting Platform\Voting_Platform"

my .env file has the following code FLASK_APP=runserver.py

Also I ran the following command to test if dotenv is able to locate my Environment File. I think it did find the file. (see below) dotenv test

I am confused why the flask isn't able to read my .env file

1

1 Answers

0
votes

I never develop flask in windows, but you can read this document to get clue for you problem.

Happy coding.