freshcrate
Home > Frameworks > dynaconf

dynaconf

The dynamic configurator for your Python Project

Description

<!-- [![Dynaconf](docs/img/logo_400.svg?sanitize=true)](http://dynaconf.com) --> <p align="center"><img src="/art/header.png?v2" alt="dynaconf. new logo"></p> > **dynaconf** - Configuration Management for Python. [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](/LICENSE) [![PyPI](https://img.shields.io/pypi/v/dynaconf.svg)](https://pypi.python.org/pypi/dynaconf) [![PyPI](https://img.shields.io/pypi/pyversions/dynaconf.svg)]() ![PyPI - Downloads](https://img.shields.io/pypi/dm/dynaconf.svg?label=pip%20installs&logo=python) [![CI](https://github.com/dynaconf/dynaconf/actions/workflows/main.yml/badge.svg)](https://github.com/dynaconf/dynaconf/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/dynaconf/dynaconf/branch/master/graph/badge.svg)](https://codecov.io/gh/dynaconf/dynaconf) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/3fb2de98464442f99a7663181803b400)](https://www.codacy.com/gh/dynaconf/dynaconf/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dynaconf/dynaconf&amp;utm_campaign=Badge_Grade) ![GitHub stars](https://img.shields.io/github/stars/dynaconf/dynaconf.svg) ![GitHub Release Date](https://img.shields.io/github/release-date/dynaconf/dynaconf.svg) ![GitHub commits since latest release](https://img.shields.io/github/commits-since/dynaconf/dynaconf/latest.svg) ![GitHub last commit](https://img.shields.io/github/last-commit/dynaconf/dynaconf.svg) [![Code Style Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black/) ![GitHub issues](https://img.shields.io/github/issues/dynaconf/dynaconf.svg) [![User Forum](https://img.shields.io/badge/users-forum-blue.svg?logo=googlechat)](https://github.com/dynaconf/dynaconf/discussions) [![Join the chat at https://gitter.im/dynaconf/dev](https://badges.gitter.im/dynaconf/dev.svg)](https://gitter.im/dynaconf/dev?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![ Matrix](https://img.shields.io/badge/dev-room-blue.svg?logo=matrix)](https://matrix.to/#/#dynaconf:matrix.org) ## Features - Inspired by the [12-factor application guide](https://12factor.net/config) - Settings management (default values, validation, parsing, templating) - Protection of sensitive information (passwords/tokens) - Multiple file formats `toml|yaml|json|ini|py` and also customizable loaders. - Full support for environment variables to override existing settings (dotenv support included). - Optional layered system for multi environments `[default, development, testing, production]` - Built-in support for Hashicorp Vault and Redis as settings and secrets storage. - Built-in extensions for **Django** and **Flask** web frameworks. - CLI for common operations such as `init, list, write, validate, export`. - full docs on https://dynaconf.com ### Install ```bash $ pip install dynaconf ``` #### Initialize Dynaconf on project root directory ```plain $ cd path/to/your/project/ $ dynaconf init -f toml βš™οΈ Configuring your Dynaconf environment ------------------------------------------ 🐍 The file `config.py` was generated. πŸŽ›οΈ settings.toml created to hold your settings. πŸ”‘ .secrets.toml created to hold your secrets. πŸ™ˆ the .secrets.* is also included in `.gitignore` beware to not push your secrets to a public repo. πŸŽ‰ Dynaconf is configured! read more on https://dynaconf.com ``` > **TIP:** You can select `toml|yaml|json|ini|py` on `dynaconf init -f <fileformat>` **toml** is the default and also the most recommended format for configuration. #### Dynaconf init creates the following files ```plain . β”œβ”€β”€ config.py # This is from where you import your settings object (required) β”œβ”€β”€ .secrets.toml # This is to hold sensitive data like passwords and tokens (optional) └── settings.toml # This is to hold your application settings (optional) ``` On the file `config.py` Dynaconf init generates the following boilerpate ```py from dynaconf import Dynaconf settings = Dynaconf( envvar_prefix="DYNACONF", # export envvars with `export DYNACONF_FOO=bar`. settings_files=['settings.yaml', '.secrets.yaml'], # Load files in the given order. ) ``` > **TIP:** You can create the files yourself instead of using the `init` command as shown above and you can give any name you want instead of the default `config.py` (the file must be in your importable python path) - See more options that you can pass to `Dynaconf` class initializer on https://dynaconf.com #### Using Dynaconf Put your settings on `settings.{toml|yaml|ini|json|py}` ```toml username = "admin" port = 5555 database = {name='mydb', schema='main'} ``` Put sensitive information on `.secrets.{toml|yaml|ini|json|py}` ```toml password = "secret123" ``` > **IMPORTANT:** `dynaconf init` command puts the `.secrets.*` in your `.gitignore` to avoid it to be exposed on public repos but it is your responsibility to keep it safe in your local environment, also the recommendat

Release History

VersionChangesUrgencyDate
3.2.13Imported from PyPI (3.2.13)Low4/21/2026
3.2.12## What's Changed * Incremental improvment to access performance by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1304 * fix: get method to return Any type. by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/1314 * perf: add lru caching to `find_the_correct_casing` function by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1326 **Full Changelog**: https://github.com/dynaconf/dynaconf/compare/3.2.11...3.2.12Low10/10/2025
3.2.11## What's Changed Release version 3.2.11 Shortlog of commits since last release: - Bruno Rocha (9): @rochacbruno - fix(cli): handle empty hooks and boolean environments. - fix: Better way for CLI to find the Django Settings - fix: windows CI - feat: Run CLI as module with `python -m dynaconf` (#1290) - fix: use sys.argv instead of click.get_os_args (#1292) - fix: `-k` must exit code 1 when key do not exist (#1293) - feat: envless load file Low5/6/2025
3.2.10### Hot Fixes - Hotfix hook collector to avoid eager evaluation. (#1255). *By Bruno Rocha*. ### Bug Fixes - Parse data type on merge with comma separated value. *By Bruno Rocha*. ### Features - Add CLI command `debug-info` (#1251). *By Bruno Rocha*. - Add support for decorated hooks on settings files (#1246). *By Bruno Rocha*. - Add VAULT_TOKEN_RENEW_FOR_DYNACONF config/code (#1094) (#1242). *By Pedro Brochado*. - populate_obj takes convert_to_dict (#1237). *By Bruno Rocha*. -Low2/17/2025
3.2.9Release 3.2.9Low2/16/2025
3.2.8YANKED VERSIONLow2/16/2025
3.2.7Async Release for Integration with Ansible Automation Platform ## What's Changed * [backport] fix(inspect): Fixed an error that would raise when using get_history with lazy values by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1185 * [Backport 3.2] Fix early trigger of lazy value by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1198 * AWX Integration fixes by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/1204 ### Bug Fixes - lazy validator's defaulLow1/21/2025
3.2.6## [3.2.6](https://github.com/dynaconf/dynaconf/releases/tag/3.2.6) - 2024-07-19 ### Bug Fixes - Don't instantiate a Settings object for every hook call. ### Details SCENARIO: With a `function` as `_registered_hooks` every time a key is accessed on `settings` the `function` is invoked passing a `settings` object as first argument. BEFORE: The `settings` passed to the hook was instantiated for every call. AFTER: The `settings` is now a `TempSettingsHolder` that has noLow7/19/2024
3.2.5## [3.2.5](https://github.com/dynaconf/dynaconf/releases/tag/3.2.5) - 2024-03-18 ### Bug Fixes - `_bypass_evaluation` showing in end-user settings (#1071). *By Pedro Brochado*. - dependabot alert 21 about Django (on tests) (#1067). *By Bruno Rocha*. - include load with relative root path (#1049). *By Pedro Brochado*. ### Features - Add `@get` converter to alias existing keys (#1040). *By Bruno Rocha*. ### Docs - fix wrong info about validation trigger on insantiation (#1076). *By Pedro BroLow3/18/2024
3.2.4## What's Changed ## Bugfix * non-str key raising type error #1005 by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1008 * dynaconf_merge=False on nested structures by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1012 * support for 'entrypoint-path' in FLASK_APP #946 by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/1014 * allow underscore in env name #1011 by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/1015 * Fix link to configuration page by Low2/10/2024
3.2.3## What's Changed * fix: pep8 errors by @anderson-sousa in https://github.com/dynaconf/dynaconf/pull/995 * Fix #1000 Django AttributeError on admin by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/1002 **Full Changelog**: https://github.com/dynaconf/dynaconf/compare/3.2.2...3.2.3Low9/13/2023
3.2.2## What's Changed * Hooking: Add support for changing the wrapped class by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/975 * Hotfix bypass evaluation #984 by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/985 * Fix #976 from envvars parse True/False as booleans by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/983 * Fix #982 glob on settings_files by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/987 * Inspect Review by @pedro-psb in https://giLow8/26/2023
3.2.1## What's Changed * CI - Test docker-compose pyyaml issue by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/964 * Support for multidoc yaml files by @mganisin in https://github.com/dynaconf/dynaconf/pull/825 * Fix: unexpected _bypass_evaluation in BoxList by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/966 * Doc advanced usage for cli overrides dynaconf settings fix #967 by @hugoprudente in https://github.com/dynaconf/dynaconf/pull/970 ## New Contributors * @mganisin Low8/11/2023
3.2.0## What's Changed * Add merge argumento to `loader.write` to fix #839 by @Mdslino in https://github.com/dynaconf/dynaconf/pull/875 * fix #876 - avoid failure on deleted cwd by @rochacbruno in https://github.com/dynaconf/dynaconf/pull/877 * Docs/add faq page by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/882 * CI - Prevent running when just doc changes are made by @pedro-psb in https://github.com/dynaconf/dynaconf/pull/885 * CI - Prevent running when just doc changes are made (fiLow7/13/2023
3.1.12Release 3.1.12Low3/2/2023
3.1.11Dynaconf 3.1.11 Amadou Crookes (1): envars.md typo fix (#786) Bruno Rocha (19): Release version 3.1.9 Bump dev version to 3.1.10 Update badges demo repo will be replaced by a video tutorial soon Fix CI New data key casing must adapt to existing key casing (#795) Add test and docs about includes (#796) Removed vendor_src folder (#798) Replacing rochacbruno/ with dynaconf/ (#Low9/22/2022
3.1.10YANKED - Go to 3.1.11Low9/22/2022
3.1.9## What's Changed * Bump django from 2.2.27 to 2.2.28 in /example/django_pytest_pure by @dependabot in https://github.com/rochacbruno/dynaconf/pull/743 * Multiple fixes for 3.19 by @rochacbruno in https://github.com/rochacbruno/dynaconf/pull/756 * Organize pre-commit setup by @johnnv1 in https://github.com/rochacbruno/dynaconf/pull/757 * update docs site by @rochacbruno in https://github.com/rochacbruno/dynaconf/pull/758 ## New Contributors * @johnnv1 made their first contribution in httLow6/6/2022
3.1.8Release 3.1.8Low4/15/2022
3.1.7Release 3.1.7Low9/9/2021
3.1.6Release 3.1.6Low9/9/2021
3.1.5Release 3.1.5Low8/20/2021
3.1.4Release 3.1.4Low3/8/2021
3.1.3Release 3.1.3Low3/4/2021
3.1.3rc1Release 3.1.3rc1Low3/1/2021
3.1.2Release 3.1.2Low10/8/2020
3.1.1 Andreas Poehlmann (1): Allow importing SEARCHTREE before settings are configured (#383) Bruno Rocha (38): Hot fix removing unused imports Merge branch 'master' of github.com:rochacbruno/dynaconf Removing invalid links, adding allert on old docs fix #369 and fix #371 (#372) Fix #359 lazy template substitution on nested keys (#375) Flask fizes and other issues included. (#376) Fix #379 dict like iteration (#38Low9/21/2020
3.1.1rc6Release 3.1.1rc6Low9/21/2020
3.1.1rc5Release 3.1.1rc5Low9/21/2020
3.1.1rc4Release 3.1.1rc4Low9/19/2020
3.1.1rc3Release 3.1.1rc3Low9/17/2020
3.1.1rc2Release 3.1.1rc2Low9/14/2020
3.1.1rc1Release 3.1.1rc1Low9/12/2020
3.1.0Release 3.1.0Low8/14/2020
3.0.0Release 3.0.0Low6/29/2020
3.0.0rc2Release 3.0.0rc2Low6/22/2020
3.0.0rc1Release 3.0.0rc1Low3/10/2020
2.2.3Release 2.2.3Low2/28/2020
2.2.2Release 2.2.2Low12/26/2019
2.2.1Release 2.2.1Low12/6/2019
2.2.0Release 2.2.0Low10/9/2019
2.1.1Release 2.1.1Low9/16/2019
2.1.0# Highlights: ## 🐲Nested envvars w/ DUNDER__KEYS (useful for #django) Lets say you have a configuration like this: `settings.py` ```py DATABASES = { 'default': { 'NAME': 'db', 'ENGINE': 'module.foo.engine', 'ARGS': {'timeout': 30} } } ``` And now you want to change the values of `ENGINE` to `other.module`, via environment variables you can use the format `${ENVVAR_PREFIX}_${VARIABLE}__${NESTED_ITEM}__${NESTED_ITEM}` Each `__` (dunder, aLow9/5/2019
2.0.4Release 2.0.4Low8/22/2019
2.0.3Release 2.0.3Low6/27/2019
2.0.2Release 2.0.2Low4/29/2019
2.0.1Release 2.0.1Low4/22/2019
2.0.0Dynaconf 2.0.0 - Fix #129 get_fresh should be case insensitive - Fix #125 .configure was not loading `settings_module` passed as argument - Fix #127 fix YAML warnings and default to full_load - Allow disable of core loaders #122 - Added support for Jenkins secrets file #117 - Added more examples for includes #110 - Moved to Azure Pipelines CI #142 - Added 100% test coverage on windows (Unit & Functional tests) - Deprecated MERGE_ENABLED in favor of local dynaconf_merge - Fix #74 - BeLow4/9/2019
1.2.1Release version 1.2.1 Shortlog of commits since last release: Bruno Rocha (9): Merge branch 'jperras-merge-multiple-settings-files' Merge branch 'master' of github.com:rochacbruno/dynaconf Fix #106 make PROJECT_ROOT_FOR_DYNACONF to work with custom paths Update dynaconf/utils/boxing.py Update dynaconf/utils/boxing.py Add release script and CHANGELOG in place of history. Low3/11/2019
1.1.0- Added `MERGE_ENABLED_FOR_DYNACONF` with ability to merge nested dictionaries instead of replacing PR #88 - Support for dot notation to access nested dictionaries like `settings['KEY.OTHER.NESTED.DEEPER']` PR #93 - Support dotted notation for validators PR #98 - Fixed a bug in SETTINGS_MODULE cleanup when `.setenv` method was called PR #97 - Added Python 3.7 to test matrix PR #99 Bruno Rocha (8): add example for merge_configs Merge branch 'rsnyman-merge-settings' MeLow10/26/2018

Dependencies & License Audit

Loading dependencies...

Similar Packages

pre-commitA framework for managing and maintaining multi-language pre-commit hooks.v4.6.0
azure-core-tracing-opentelemetryMicrosoft Azure Azure Core OpenTelemetry plugin Library for Pythonazure-template_0.1.0b6187637
spdx-toolsSPDX parser and tools.0.8.5
lacesDjango components that know how to render themselves.0.1.2
django-tasksA backport of Django's built in Tasks framework0.12.0