Replies: 2 comments
-
|
I couldn't reproduce this. I used your file as a config.py, this main.py: and this .env: Changing either API_DOCS_USERNAME's string or TESTING boolean on my .env works upon reloading the server. The values in these settings are updated as expected. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
thank you for checking. but sorry, by now I am pretty sure its caused by VSCode and forgot to close this ticket. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Generally FastAPI is able to read data from the
.envfile but it is then somehow cached. Restarting the server does not re-read the.envvalues. Adding a new or renaming an setting works as expected. However, changing a value of a previously read setting has no effect. Even when removing theenv_file = “.env”bit.The issue seems to affect boolean values only. However, it does handle False vs. True properly, both via .env as well as via proper env variables.
Operating System
Linux, macOS
Operating System Details
No response
FastAPI Version
0.68.2
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions