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.

An option to specify .env filename

See original GitHub issue

Hi. Similarly to django-configurations, it could be very convenient to be able to specify an environment filename with variables, not just to have .env hard-coded. For example, I could therefore specify a set of vars for different environments, e.g. prod.env, staging.env, and I could switch them using another env variable, e.g.:

DECOUPLE_CONFIGURATION=staging.env python program.py

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:6

github_iconTop GitHub Comments

5reactions
rednakscommented, Apr 4, 2019

Hi @balta2ar while I think it’s a good idea too, and thinking about the best way how to implement it, you’re still can use from decouple import AutoConfig and use the search_path argument:

config = AutoConfig(search_path='./staging-env/') 

while your you have this ./stagin-env/.env

2reactions
henriquebastoscommented, Nov 14, 2019

I don’t understand the need for this since the role purpose of decouple is to avoid having different settings layouts. The values may change on each instance, but the keys must all be the same in every environment.

Can anyone detail a concrete and real use case for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

An option to specify .env filename · Issue #73 - GitHub
Hi. Similarly to django-configurations, it could be very convenient to be able to specify an environment filename with variables, ...
Read more >
Environment variables in Compose | Docker Documentation
You can set default values for any environment variables referenced in the Compose file, or used to configure Compose, in an environment file...
Read more >
What is .env ? How to Set up and run a .env file in Node?
How to Set up and read a .env file ? The dotenv package for handling environment variables is the most popular option in...
Read more >
How To Use Environment Files with env-cmd | DigitalOcean
Learn how to add handle environment variables with the env-cmd package. ... can change the file type and path with the --file (...
Read more >
Managing .env files and setting variables - Prisma
Manually set an environment variable on a Mac/Linux system. From a terminal on a Unix machine (Mac/Linux), you export the variable as a...
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