python-dotenv
python-dotenv copied to clipboard
feat: add with_env param in dotenv_values
@theskumar could you please check this pr when you have time?
This feels more like a feature blot and I'm curious to know your use case for this.
In my server, there are many deployed jobs. For example job a and job b.
In the beginning, I want to deploy job a and job b in the same server to save money, but I want to keep it flexible so I bind domain name a.ramwin.com and b.ramwin.com to the same server. And job a handle the requests whose url is a.ramwin.com and job b handle the requests whose url is b.ramwin.com. So both job a and job b use the same code like this:
my_domain = dotenv_values(with_env=True)
assert request.domain == my_domain, "I shouldn't accept the wrong request, please config your proxy server"
By default the job process should get the domain name from host, but you can configure it with custom .env file.