dotenv override?
See original GitHub issueIs there any reason override is set to True here? dotenv.load_dotenv(denv, override=True)
I prefer using envdir
since it lets me explicitly define the environment variables for local development vs production. I end up creating a .env
file anyway for compatibility with other software like pipenv
, docker-compose
, pycharm
, etc.
When I want to run my app locally using production environment variables, I’m running into an issue because of the override=True
.
The command envdir envs/prod pipenv run python src/manage.py runserver
will end up using the .env
variables instead of those provided through envdir.
Can you either set override
to False or allow disabling .env
files?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
dotenv-override
Loads environment variables from .env file (with override feature). Latest version: 5.0.1, last published: 5 years ago.
Read more >Add an option which allows override environment variables
I've always treated the .env files as me stating this MUST be my environment. It is what it is though, and dotenv is...
Read more >Does dotenv override envvars set by docker compose?
It seems like dotenv does not override variables if they are defined in the environment, by design: By default, it won't overwrite existing ......
Read more >Note that dotenv does not overwrite environment variables ...
Note that dotenv does not overwrite environment variables that have already been set by default when running node (eg. process.env.TZ).
Read more >File: README — Documentation for dotenv (2.8.1)
Can I use dotenv in production? · What other .env* files can I use? · Should I commit my .env file? · Why...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
added a patch
I’ll give it a shot. It feels weird to create an env file just to run my app in a different way. I really like what pipenv and pew do with subshells and I think envdir just takes that a step forward.
I do think this the configuration should exist though if pipenv wants to be / is the “official” language package manager which tend to be less opinionated and more unix-y (less features, more configurable and composable with other tools).