There must be a simple way to load a .env
environment file when launching a Flask app with the cli command flask run
. I cant find an answer anywhere they all suggest loading the variables with python which I don't want to do. I am trying to run this on a Linux machine.
CodePudding user response:
pip install python-dotenv
Then place this in the app.py
file
from dotenv import load_dotenv
load_dotenv()