Describe the bug
I have a dynaconf settings.yaml file with layered environments however, I am unable to overwrite/merge some of the parameters using environment variables.
To Reproduce
Steps to reproduce the behavior:
- Having the following config files:
Config files
/path/.env
and
/path/settings.yaml
default:
PARAM_1: ''
docker:
some_config:
config_a:
some_param: 'cde'
another_param: 'abc'
config_b:
different_param: 123
PARAM_2: ''
PARAM_3: ''
production:
PARAM_1: 'param_1_for_prod'
docker:
PARAM_2: 'param2_for_prod'
PARAM_3: 'param3_for_dev'
development:
PARAM_1: 'param_1_for_dev'
docker:
PARAM_2: 'param2_for_dev'
PARAM_3: 'param3_for_dev'
- Having the following app code:
Code
/path/src/config.py
from dynaconf import settings
settings = Dynaconf(
envvar_prefix='MY_APP',
merge_enabled=True,
environments=True,
default_env='default',
env='production',
env_switcher='MY_APP_ENV',
ignore_unknown_envvars=True,
settings_files=['settings.yaml', '.secrets.yaml']
)
- Executing under the following environment
Execution
export MY_APP_DOCKER__PARAM_2=my_param
Expected behavior
I would expect that the setting settings.docker.PARAM_2 would be equal to my_param but for some reason this does not work.
The strange thing is that
export MY_APP_PARAM_1=another_param
does work.
The following also works, but for PARAM_3 it does not.
export MY_APP_DOCKER='@merge {PARAM_2=my_param}'
Environment (please complete the following information):
- OS: OSX Big Sur (11.3)
- Dynaconf Version: 3.1.5
- Frameworks in use: -
Additional context
Add any other context about the problem here.
Describe the bug
I have a dynaconf settings.yaml file with layered environments however, I am unable to overwrite/merge some of the parameters using environment variables.
To Reproduce
Steps to reproduce the behavior:
Config files
/path/.env
and
/path/settings.yaml
Code
/path/src/config.py
Execution
export MY_APP_DOCKER__PARAM_2=my_paramExpected behavior
I would expect that the setting
settings.docker.PARAM_2would be equal tomy_parambut for some reason this does not work.The strange thing is that
export MY_APP_PARAM_1=another_paramdoes work.
The following also works, but for
PARAM_3it does not.Environment (please complete the following information):
Additional context
Add any other context about the problem here.