An option to specify .env filename
See original GitHub issueHi. 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:
- Created 5 years ago
- Reactions:10
- Comments:6
Top 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 >
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 Free
Top 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
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 thesearch_path
argument:while your you have this
./stagin-env/.env
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?