Skip to content Skip to sidebar Skip to footer

.flaskenv Or .env File Not Being Read

I have a flask app that uses some enviroment variables, I don't now what has changed but now it doesn't read the variables in the .flaskenv file, already tried changing its name to

Solution 1:

As written in the flask docs:

If python-dotenv is installed, running the flask command will set environment variables defined in the files .env and .flaskenv. This can be used to avoid having to set FLASK_APP manually every time you open a new terminal, and to set configuration using environment variables similar to how some deployment services work.

make sure to run pip install python-dotenv

Edit

This flask seems to be very old, try updating it with

pip install -U flask

Post a Comment for ".flaskenv Or .env File Not Being Read"