-
I'm using dynaconf 3.1.12 under Python 3.9. I'm having an issue (similar to others that have been reported) where dynaconf doesn't seem to find/load my settings.toml file. EDIT Note: It appears to be loading the file, but not merging the settings (see my later comments). My code is structured like this:
where config.py creates the settings object using
as recommended at #374 (comment) to work around various IDE issues when debugging, etc. __init.py exposes the settings to the outside world using
and run_me.py has
and the settings.toml file is
But when I run run_me.py it throws an error saying
When running/debugging (PyCharm) I have the working directory set to the full path to the top level my_pkg directory, as recommended in various other posts here. The full script path that is being run under the IDE is
Previously I was using the older method of accessing settings using (at the top of run_me.py)
Now I'm trying to convert to the newer, recommend way of configuring dynaconf. I'm clearly missing some nuance. Any tips would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I can see in the debugger that
so it appears that it is loading the file. But I can't seem to access the settings. |
Beta Was this translation helpful? Give feedback.
-
More testing, I can access the settings value using this syntax
By explicitly specifying the ENVIRONMENT. I can see that I am using the DEFAULT environment because
It's as if the loaded settings aren't getting merged into the overall settings ... |
Beta Was this translation helpful? Give feedback.
-
Ok, found the answer. According to https://github.com/dynaconf/dynaconf/blob/master/3.x-release-notes.md,
so if I initialize my settings and add the
The "old_school" method of specifying the settings in settings.toml works where they were under |
Beta Was this translation helpful? Give feedback.
Ok, found the answer. According to https://github.com/dynaconf/dynaconf/blob/master/3.x-release-notes.md,
so if I initialize m…