Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add with_env param in dotenv_values #385

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ramwin
Copy link

@ramwin ramwin commented Mar 8, 2022

No description provided.

@ramwin ramwin mentioned this pull request Mar 8, 2022
@ramwin
Copy link
Author

ramwin commented Apr 5, 2022

@theskumar could you please check this pr when you have time?

@theskumar
Copy link
Owner

This feels more like a feature blot and I'm curious to know your use case for this.

@ramwin
Copy link
Author

ramwin commented Jun 20, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants