-
-
Notifications
You must be signed in to change notification settings - Fork 318
Dotted key in YAML settings file #718
Copy link
Copy link
Closed
Description
Hello,
I work on a project where YAML is mandatory for configuration. In the settings.yaml file, we have some keys that includes . (dot) , but Dynaconf interprets it as a variables separator.
- python=3.9.7
- dynaconf=3.1.7
# settings.yaml
default:
www.google.com: truefrom dynaconf import Dynaconf
import yaml
settings = Dynaconf(
settings_files=["config/settings.yaml"],
environments=True,
)
print(yaml.dump(settings.as_dict(), sort_keys=False, default_flow_style=False))returns
WWW:
GOOGLE:
COM: trueI know that if we use the .set method, we can have a work-around :
settings.set("www.google.com", True, dotted_lookup=False)Returns:
WWW.GOOGLE.COM: trueBut I can't see a way to apply this dotted_lookup parameter to the YAML core loader.
I tried with simple & double quotes, also with escaping (\.), but without success.
Potential related issue #685
Can you help please ?
Reactions are currently unavailable