Closed romado77 closed 3 years ago
You want to create an different env file based on the environment which user or developer make or use in each of his/her development
You want to create an different env file based on the environment which user or developer make or use in each of his/her development
That is the idea
You want to create an different env file based on the environment which user or developer make or use in each of his/her development
That is the idea
Its nice so we can isolate an .env for production and development branch
Hi. I don’t understand why would this be useful because this change would couple your code with the instance configuration which is precisely what we avoid.
Python decouple works by enabling you to have one code that works in any instance without change.
The proper way to achieve the desired behavior is not via decouple, but outside your source code.
You could have your env files in a contrib dir like contrib/dev.env
, contrib/production.env
and have a run script that copy the desired file as your .env and executes your code.
This would enable you to have one source code for any instance and enable you to choose between env files.
Proposed enhancement allows to pickup configuration file instead of going through fixed list of
.env
andsettings.ini
. For example staging environment could have configuration instage.env
, while development environment indev.env
.Environment could be chosen by following:
test.py
dev.env