dynaconf

Configuration Management for Python ⚙

MIT License

Downloads
2.8M
Stars
3.6K
Committers
125

Bot releases are visible (Hide)

dynaconf - 3.1.1

Published by rochacbruno about 4 years ago

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 (#385)
      Fix #377 allow computed values (#386)
      Fix #388 URL reference for custom loaders (#389)
      Fix #382 add is_overriden method (#390)
      Release version 3.1.0
      Create FUNDING.yml
      Fix #391 make box_settings optional, change vendoring strategy (#398)
      HOTFIX: Add missing vendor.txt
      Allow nested Lazy Values (#405)
      Makes   PEP8 more strictly and remove unused variables (#408)
      Merge branch 'master' into vault
      boto is optional
      Merge branch 'vault' into master
      Included example of custom SOPS loader to the docs
      Release version 3.1.1rc1
      HOTFIX: Logging instance has a `formatter` attribute (#410)
      Release version 3.1.1rc2
      Fix set attribute directly and fresh vars (#412)
      384 fix tail and dotted merge (#415)
      Fix #404 no more dup message on combined validators (#417)
      HOTFIX 414 update docs version on release
      Release version 3.1.1rc3
      HOTFIX: Add missing instruction to release.sh
      Added full Dynaconf Diagram and few fizes. (#418)
      Release version 3.1.1rc4
      Small fix on release script
      Minification of vendored modules (#419)
      Release version 3.1.1rc5
      Do not include vendor_src on wheel target (#420)
      Release version 3.1.1rc6
      HOTFIX: Cli now accepts dotter keys
      Release version 3.1.1

Christoph Schmatzler (1):
      Fix typo in Validation docs (#394)

Gabriel Simonetto (1):
      Fix #399 - Update documentation link (#401)

Jiranun Jiratrakanvong (1):
      Add auth username and password for redis settings (#378)

John Vandenberg (1):
      Allow testing against local redis server (#387)

Martijn Pieters (1):
      Correct typos in documentation and README (#400)

Max Winterstein (1):
      Fix typo in release notes (#411)

Mirek Długosz (2):
      Test all names in Validator("foo", "bar", must_exist=False) (#406)
      Fix #407 - add proper equality test for CombinedValidator (#413)

Nikolai Bessonov (1):
      fix a typo (#393)

Peng Yin (5):
      Read all secrets under a vault path
      Add option to auth vault with iam role
      Fix format
      Fix test for versioned kv engine in latest vault
      Merge branch 'master' into vault

Piotr Baniukiewicz (1):
      Fix validation of optional fields (#370)

whg517 (1):
      docs: Fixed filename error in the case of the index page (#396)
dynaconf - 3.1.1rc6

Published by rochacbruno about 4 years ago

dynaconf - 3.1.1rc5

Published by rochacbruno about 4 years ago

dynaconf - 3.1.1rc4

Published by rochacbruno about 4 years ago

dynaconf - 3.1.1rc3

Published by rochacbruno about 4 years ago

dynaconf - 3.1.1rc2

Published by rochacbruno about 4 years ago

dynaconf - 3.1.1rc1

Published by rochacbruno about 4 years ago

dynaconf - 3.1.0

Published by rochacbruno about 4 years ago

dynaconf - 3.0.0

Published by rochacbruno over 4 years ago

dynaconf - 3.0.0rc2

Published by rochacbruno over 4 years ago

dynaconf - 3.0.0rc1

Published by rochacbruno over 4 years ago

dynaconf - 2.2.3

Published by rochacbruno over 4 years ago

dynaconf - 2.2.2

Published by rochacbruno almost 5 years ago

dynaconf - 2.2.1

Published by rochacbruno almost 5 years ago

dynaconf - 2.2.0

Published by rochacbruno about 5 years ago

dynaconf - 2.1.1

Published by rochacbruno about 5 years ago

dynaconf - 2.1.0

Published by rochacbruno about 5 years ago

Highlights:

🐲Nested envvars w/ DUNDER__KEYS (useful for #django)

Lets say you have a configuration like this:

settings.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, a.k.a double underline) denotes access to nested elements in a dictionary.

So

DATABASES['default']['ENGINE'] = 'other.module'

Can be expressed as environment variables as:

export DYNACONF_DATABASES__default__ENGINE=other.module

NOTE: if you are using Django extension then the prefix will be DJANGO_ instead of DYNACONF_ and the same if you are using FLASK_ or a custom prefix if you have customized the ENVVAR_PREFIX.

This will result in

DATABASES = {
    'default': {
        'NAME': 'db',
        'ENGINE': 'other.module',
        'ARGS': {'timeout': 30}
    }
}

Read more on: https://dynaconf.readthedocs.io/en/latest/guides/environment_variables.html#nested-keys-in-dictionaries-via-environment-variables

🔃.from_env easy access to different envs

Return a new isolated settings object pointing to specified env.

Example of settings.toml::

[development]
message = 'This is in dev'
foo = 1
[other]
message = 'this is in other env'
bar = 2

Then you can use from_env:

>>> print(settings.from_env('other').MESSAGE)
'This is in other env'
>>> print(settings.from_env('other').BAR)
2
>>> print(settings.from_env('other').FOO)
AttributeError: settings object has no attribute 'FOO'

The existing settings object remains the same.

>>> print(settings.MESSAGE)
'This is in dev'

Read more on: https://dynaconf.readthedocs.io/en/latest/guides/advanced_usage.html#from-env

📋$dynaconf list -o export your settings as a file

dynaconf list -o path/to/file.yaml

The above command will export all the items showed by dynaconf list to the desired format which is inferred by the -o file extension, supported formats yaml, toml, ini, json, py

When using py you may want a flat output (without being nested inside the env key)

dynaconf list -o path/to/file.py --output-flat

Read more on: https://dynaconf.readthedocs.io/en/latest/guides/cli.html#exporting-current-environment-as-a-file

🔐@HashiCorp #Vault & @RedisLabs supports multiple envs

If you want to write to specific env pass the -e option.

$ dynaconf write redis -v name=Bruno -v database=localhost -v port=1234 -e production

The above data will be recorded in redis as a hash:

DYNACONF_PRODUCTION {
    NAME='Bruno'
    DATABASE='localhost'
    PORT='@int 1234'
}

Then to access that values you can set export ENV_FOR_DYNACONF=production or directly via settings.from_env('production').NAME

Read more on: https://dynaconf.readthedocs.io/en/latest/guides/external_storages.html

Dynaconf 2.1.0

Bruno Rocha (8):
      Release version 2.0.4
      Merge branch 'dgarcia360-master'
      Fix #197 add support for DOTTED__ENV__VARS (#215)
      Add support to export merged env to filesystem via cli. (#217)
      Adds `from_env` method and change `_store` to be a `DynaBox` (#219)
      hotfix: next release will be 2.1.0 because new features added. (#220)
      Fix `make test_examples` to use better assertions, redis and vault loader now respects `envs` (#222)
      fix #221 removed JSON,YAML,INI,TOML cosntants from default_settings (#223)

Kedar Kulkarni (1):
      Add `list_envs` function to vault loader and now envs can have `_` on its name.

Pavel Alimpiev (1):
      Fix typo in documentation for a Validator class (#213)

dgarcia360 (3):
      Updated configuration options table to csv table
      Added responsive table fix
      Fix format
dynaconf - 2.0.4

Published by rochacbruno about 5 years ago

dynaconf - 2.0.3

Published by rochacbruno over 5 years ago

dynaconf - 2.0.2

Published by rochacbruno over 5 years ago