question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is 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:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kennethreitzcommented, Sep 22, 2017

added a patch

1reaction
AlJohricommented, Sep 22, 2017

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found