Skip to content

Default value for missing environment variables in yaml and ini config files #459

@hbmshemet

Description

@hbmshemet

How could I specify a default value for the missing environment variable in the configuration provider?

For example:
pseudo code

config = dependency_injector.providers.Configuration() config.from_yaml("conf.yml") print(config.some_key.size) -> will print ${SOME_KEY_SIZE} if envvar is missing 

conf file

some_key: size: ${SOME_KEY_SIZE} 

or maybe we could leave such cases with empty/none values? for e.g.

config.some_key.size -> will be None 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions