-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
[bug] accessing variables using environment is not working when using include or preload. #1029
Comments
gust-p
changed the title
[bug] accessing variables using environment is not working in any way.
[bug] accessing variables using environment is not working when using include or preload.
Nov 21, 2023
Extra context: When setting header:
env_filter: None
key_filter: None
new_first: 'True'
history_limit: None
include_internal: 'False'
current:
ENVIROMENTS: true
LOAD_DOTENV: true
SECRET_KEY: supersecret
DEVELOPMENT:
debug: true
database_url: sqlite:///dev.db
PRODUCTION:
debug: false
database_url: postgres:///prod.db
ENV: production
history:
- loader: env_global
identifier: unique
env: global
merged: false
value:
ENV: production
- loader: toml
identifier: /home/leno/Repositories/kpi_refactor/config/settings.toml
env: default
merged: false
value:
DEVELOPMENT:
debug: true
database_url: sqlite:///dev.db
PRODUCTION:
debug: false
database_url: postgres:///prod.db
- loader: toml
identifier: /home/leno/Repositories/kpi_refactor/config/.secrets.toml
env: default
merged: false
value:
SECRET_KEY: supersecret
- loader: set_method
identifier: settings_module_method
env: global
merged: false
value:
SETTINGS_MODULE:
- config/.secrets.toml
- config/settings.toml
- loader: set_method
identifier: envvars_first_load
env: global
merged: false
value:
ENV_FOR_DYNACONF: production
- loader: set_method
identifier: init_kwargs
env: global
merged: false
value:
ENVIROMENTS: true
LOAD_DOTENV: true
INCLUDES_FOR_DYNACONF:
- config/config.yaml
ENV_SWITCHER_FOR_DYNACONF: APP_ENV
ENVVAR_PREFIX_FOR_DYNACONF: APP
SETTINGS_FILE_FOR_DYNACONF:
- config/.secrets.toml
- config/settings.toml With header:
env_filter: None
key_filter: None
new_first: 'True'
history_limit: None
include_internal: 'False'
current:
LOAD_DOTENV: true
ENVIROMENTS: false
LOCATION: earth
SECRET_KEY: supersecret
DEVELOPMENT:
debug: true
database_url: sqlite:///dev.db
PRODUCTION:
debug: false
database_url: postgres:///prod.db
ENV: production
history:
- loader: env_global
identifier: unique
env: global
merged: false
value:
ENV: production
- loader: toml
identifier: /home/leno/Repositories/kpi_refactor/config/settings.toml
env: default
merged: false
value:
DEVELOPMENT:
debug: true
database_url: sqlite:///dev.db
PRODUCTION:
debug: false
database_url: postgres:///prod.db
- loader: toml
identifier: /home/leno/Repositories/kpi_refactor/config/.secrets.toml
env: default
merged: false
value:
SECRET_KEY: supersecret
- loader: set_method
identifier: settings_module_method
env: global
merged: true
value:
SETTINGS_MODULE:
- config/.secrets.toml
- config/settings.toml
- loader: yaml
identifier: /home/leno/Repositories/kpi_refactor/config/config.yaml
env: default
merged: false
value:
LOCATION: earth
- loader: set_method
identifier: envvars_first_load
env: global
merged: false
value:
ENV_FOR_DYNACONF: production
- loader: set_method
identifier: init_kwargs
env: global
merged: false
value:
LOAD_DOTENV: true
ENVIROMENTS: false
SETTINGS_FILE_FOR_DYNACONF:
- config/.secrets.toml
- config/settings.toml
ENVVAR_PREFIX_FOR_DYNACONF: APP
PRELOAD_FOR_DYNACONF:
- config/config.yaml
MERGE_ENABLED_FOR_DYNACONF: true
ENV_SWITCHER_FOR_DYNACONF: APP_ENV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
env_switcher or environments is not working
To Reproduce
Steps to reproduce the behavior:
Project structure
. ├── .env ├── config │ ├── .secrets.toml │ └── settings.toml │ └── config.yaml ├── db.mysql ├── kpi.py ├── main.py ├── mypy.ini ├── poetry.lock ├── pyproject.toml └── temporary.py
Config files
./.env
APP_ENV="production"
and
/config/settings.toml
and
/config/config.yaml
Code
./main.py
Execution
Expected behavior
A clear and concise description of what you expected to happen.
Environment (please complete the following information):
Additional context
I have tried
env_switcher=APP_ENV
and running the app withAPP_ENV=production python main.py
or tryingwith settings.using_env()
The text was updated successfully, but these errors were encountered: