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

how to use multiple config file in one enviroment #16

Open
konerld opened this issue Mar 5, 2020 · 1 comment
Open

how to use multiple config file in one enviroment #16

konerld opened this issue Mar 5, 2020 · 1 comment

Comments

@konerld
Copy link

konerld commented Mar 5, 2020

Sorry, cant find contact to write PM
As i understand the one file for one environment
But is it possible to load multiple file in default enviroment?

if I use:
from config2.config import config
config.values

it return values from all enviroment but this is not able with using dict keys as method

is it possible?

thanks

@bjoluc
Copy link

bjoluc commented May 25, 2020

FWIW, that's not possible. I don't see a use case for that as well, to be honest. The purpose of different config files for different environments in general is to override arbitrary configuration values from default.yml depending on the environment your application runs in.

if I use:
from config2.config import config
config.values

it return values from all enviroment but this is not able with using dict keys as method

is it possible?

I don't really understand your question. Assuming that you define a values property in default.yml,
if the ENV environment variable is not set, config.values should only contain the values field from default.yml. Let's say you set ENV to production. If a production.yml config file exists then, config will contain the contents of default.yml, merged with the contents of production.yml. In case values is set in production.yml as well, config.values will then contain the values field from default.yml, recursively replaced/extended by the contents of values in production.yml. Otherwise, config.values will remain as specified in default.yml. Does this clarify things for you?

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

2 participants