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

Config file not working? #17

Open
JCFontoura opened this issue Jan 28, 2023 · 2 comments
Open

Config file not working? #17

JCFontoura opened this issue Jan 28, 2023 · 2 comments

Comments

@JCFontoura
Copy link

JCFontoura commented Jan 28, 2023

Hi.
In the main.py file there is an import from core.config import config, which means that get_config() is being executed before os.environ["ENV"] = env from main(), so I always end up with "development" from ENV: str = "development".
Am I missing something?

@zzzachzzz
Copy link

I noticed the exact same thing. Setting the environment variable via ENV=prod python main.py works, while python main.py --env prod does not, due to the execution order of get_config() that you mentioned, which determines the config based on the environment variable ENV.

@r0otx
Copy link

r0otx commented May 14, 2023

Я заметил то же самое. Установка переменной среды через ENV=prod python main.pyработает, а python main.py --env prodне из-за упомянутого вами порядка выполнения get_config(), который определяет конфигурацию на основе переменной среды ENV.

How fix it?

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

No branches or pull requests

3 participants