load_dotenv() returns false if uvicorn/fastapi is run with --reload #2316
Unanswered
peer-toenn
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
first off: this is my first ever post on github, so I appreciate any input on making this post more readable/understandable.
Issue
I am trying to run the server from root dir using uvicorn backend.main:app --reload in the CLI
load_env returns False
If I run the same command without the --reload flag, it works as expected.
I tried adding --env-file backend/.env but that didn't change anything
Structure
main.py:
Settings is a class that uses
to assign values to its variables
config.py
Beta Was this translation helpful? Give feedback.
All reactions