Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Overview

Django-environ

Latest version released on PyPi Build status of the master branch on Mac/Linux Build status of the master branch on Windows Test coverage contributors Package license Say Thanks! Backers on Open Collective Sponsors on Open Collective

django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables.

Photo by Singkham from Pexels

import environ
env = environ.Env(
    # set casting, default value
    DEBUG=(bool, False)
)
# reading .env file
environ.Env.read_env()

# False if not in os.environ
DEBUG = env('DEBUG')

# Raises django's ImproperlyConfigured exception if SECRET_KEY not in os.environ
SECRET_KEY = env('SECRET_KEY')

# Parse database connection url strings like psql://user:[email protected]:8458/db
DATABASES = {
    # read os.environ['DATABASE_URL'] and raises ImproperlyConfigured exception if not found
    'default': env.db(),
    # read os.environ['SQLITE_URL']
    'extra': env.db('SQLITE_URL', default='sqlite:////tmp/my-tmp-sqlite.db')
}

CACHES = {
    # read os.environ['CACHE_URL'] and raises ImproperlyConfigured exception if not found
    'default': env.cache(),
    # read os.environ['REDIS_URL']
    'redis': env.cache('REDIS_URL')
}

See the similar code, without django-environ.

     _ _                                              _
    | (_)                                            (_)
  __| |_  __ _ _ __   __ _  ___ ______ ___ _ ____   ___ _ __ ___  _ __
 / _` | |/ _` | '_ \ / _` |/ _ \______/ _ \ '_ \ \ / / | '__/ _ \| '_ \
| (_| | | (_| | | | | (_| | (_) |    |  __/ | | \ V /| | | | (_) | | | |
 \__,_| |\__,_|_| |_|\__, |\___/      \___|_| |_|\_/ |_|_|  \___/|_| |_|
     _/ |             __/ |
    |__/             |___/

The idea of this package is to unify a lot of packages that make the same stuff: Take a string from os.environ, parse and cast it to some of useful python typed variables. To do that and to use the 12factor approach, some connection strings are expressed as url, so this package can parse it and return a urllib.parse.ParseResult. These strings from os.environ are loaded from a .env file and filled in os.environ with setdefault method, to avoid to overwrite the real environ. A similar approach is used in Two Scoops of Django book and explained in 12factor-django article.

Using django-environ you can stop to make a lot of unversioned settings_*.py to configure your app. See cookiecutter-django for a concrete example on using with a django project.

Feature Support

  • Fast and easy multi environment for deploy
  • Fill os.environ with .env file variables
  • Variables casting (see supported_types below)
  • Url variables exploded to django specific package settings

Django-environ officially supports Django 1.11, 2.2 and 3.0.

Installation

$ pip install django-environ

NOTE: No need to add it to INSTALLED_APPS.

Then create a .env file:

DEBUG=on
SECRET_KEY=your-secret-key
DATABASE_URL=psql://user:[email protected]:8458/database
SQLITE_URL=sqlite:///my-local-sqlite.db
CACHE_URL=memcache://127.0.0.1:11211,127.0.0.1:11212,127.0.0.1:11213
REDIS_URL=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=ungithubbed-secret

And use it with settings.py above. Don't forget to add .env in your .gitignore (tip: add .env.example with a template of your variables).

Documentation

Documentation is available at RTFD.

Supported types

  • str
  • bool
  • int
  • float
  • json
  • list (FOO=a,b,c)
  • tuple (FOO=(a,b,c))
  • dict (BAR=key=val,foo=bar) #environ.Env(BAR=(dict, {}))
  • dict (BAR=key=val;foo=1.1;baz=True) #environ.Env(BAR=(dict(value=unicode, cast=dict(foo=float,baz=bool)), {}))
  • url
  • path (environ.Path)
  • db_url
    • PostgreSQL: postgres://, pgsql://, psql:// or postgresql://
    • PostGIS: postgis://
    • MySQL: mysql:// or mysql2://
    • MySQL for GeoDjango: mysqlgis://
    • Mysql Connector Python from Oracle: mysql-connector://
    • SQLITE: sqlite://
    • SQLITE with SPATIALITE for GeoDjango: spatialite://
    • Oracle: oracle://
    • MSSQL: mssql://
    • PyODBC: pyodbc://
    • Redshift: redshift://
    • LDAP: ldap://
  • cache_url
    • Database: dbcache://
    • Dummy: dummycache://
    • File: filecache://
    • Memory: locmemcache://
    • Memcached: memcache://
    • Python memory: pymemcache://
    • Redis: rediscache://, redis://, or rediss://
  • search_url
    • ElasticSearch: elasticsearch://
    • Solr: solr://
    • Whoosh: whoosh://
    • Xapian: xapian://
    • Simple cache: simple://
  • email_url
    • SMTP: smtp://
    • SMTP+SSL: smtp+ssl://
    • SMTP+TLS: smtp+tls://
    • Console mail: consolemail://
    • File mail: filemail://
    • LocMem mail: memorymail://
    • Dummy mail: dummymail://

Tips

Using unsafe characters in URLs

In order to use unsafe characters you have to encode with urllib.parse.encode before you set into .env file.

DATABASE_URL=mysql://user:%[email protected]:3306/dbname

See https://perishablepress.com/stop-using-unsafe-characters-in-urls/ for reference.

Smart Casting

django-environ has a "Smart-casting" enabled by default, if you don't provide a cast type, it will be detected from default type. This could raise side effects (see #192). To disable it use env.smart_caset = False. New major release will disable it as default.

Multiple redis cache locations

For redis cache, multiple master/slave or shard locations can be configured as follows:

CACHE_URL='rediscache://master:6379,slave1:6379,slave2:6379/1'

Email settings

In order to set email configuration for django you can use this code:

EMAIL_CONFIG = env.email_url(
    'EMAIL_URL', default='smtp://user:[email protected]:25')

vars().update(EMAIL_CONFIG)

SQLite urls

SQLite connects to file based databases. The same URL format is used, omitting the hostname, and using the "file" portion as the filename of the database. This has the effect of four slashes being present for an absolute

file path: sqlite:////full/path/to/your/database/file.sqlite.

Nested lists

Some settings such as Django's ADMINS make use of nested lists. You can use something like this to handle similar cases.

# DJANGO_ADMINS=John:[email protected],Jane:[email protected]
ADMINS = [x.split(':') for x in env.list('DJANGO_ADMINS')]

# or use more specific function

from email.utils import getaddresses

# DJANGO_ADMINS=Full Name <ema[email protected]>,[email protected]
ADMINS = getaddresses([env('DJANGO_ADMINS')])

Multiline value

You can set a multiline variable value:

# MULTILINE_TEXT=Hello\\nWorld
>>> print env.str('MULTILINE_TEXT', multiline=True)
Hello
World

Proxy value

You can set a value prefixed by $ to use as a proxy to another variable value:

# BAR=FOO
# PROXY=$BAR
>>> print env.str('PROXY')
FOO

Multiple env files

It is possible to have multiple env files and select one using environment variables.

env = environ.Env()
env.read_env(env.str('ENV_PATH', '.env'))

Now ENV_PATH=other-env ./manage.py runserver uses other-env while ./manage.py runserver uses .env.

Tests

$ git clone [email protected]:joke2k/django-environ.git
$ cd django-environ/
$ python setup.py test

How to Contribute

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
  2. Fork the repository on GitHub to start making your changes to the develop branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to Authors file.

License

This project is licensed under the MIT License - see the License file file for details

Changelog

See the Changelog file which format is inspired by Keep a Changelog.

Credits

Contributors

Thank you to all the people who have already contributed. Repo Contributors

Backers

Thank you to all our backers! Backers on Open Collective

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Became sponsor.

Sponsor Sponsor Sponsor

Comments
  • How to make django-environ work with uwsgi emperor?

    How to make django-environ work with uwsgi emperor?

    I use this project with my django projection, deployed by uwsgi(emperor mode) + nginx, it worked well, thanks for your working, but when i touch the uwsgi config file, the env vars will not reload, for now, i can send signal 3 to the process which served my django app,, is there any good ways to make this done?

    (sorry for my poor english...

    question 
    opened by tiany 19
  • Escaped Dollar sign ($) in string environment variables not getting cleaned after import

    Escaped Dollar sign ($) in string environment variables not getting cleaned after import

    Hi People,

    I've encountered an issue while setting the EMAIL_HOST_PASSWORD environment variable.

    If you have Dollar sign $ in the beginning of your env variable string django-environ treats it as another environment variable (nested variable): .env file:

    EMAIL_HOST_PASSWORD='$my_password_including_$_sign_in_the_beginning'
    

    settings.py

    EMAIL_HOST_PASSWORD = env.str('EMAIL_HOST_PASSWORD')
    

    This configuration raises:

    django.core.exceptions.ImproperlyConfigured: Set the my_password_including_$_sign_in_the_beginning environment variable
    

    which as you can see omitted the first $ sign.

    Now if we try to escape the $ character with a backslash and change our .env file to this:

    EMAIL_HOST_PASSWORD='\$my_password_including_$_sign_in_the_beginning'
    

    django-environ escapes the backslash instead of the dollar sign $ and we end up with something like this:

    >>> from django.conf import settings
    >>> settings.EMAIL_HOST_PASSWORD
    '\\$my_password_including_$_sign_in_the_beginning'
    

    Which breaks our configurations and settings.

    This is my proposal which if is agreed on I'll make a pull request:

    # Current string reader function
    def str(self, var, default=NOTSET, multiline=False):
        """
        :rtype: str
        """
        value = self.get_value(var, default=default)
        if multiline:
            return value.replace('\\n', '\n')
        return value
    
    
    # My proposal for string function, which we can use escape=True while passing env variables that have such characters
    def str(self, var, default=NOTSET, multiline=False, escape=False):
        """
        :rtype: str
        """
        value = self.get_value(var, default=default)
        if multiline:
            return value.replace('\\n', '\n')
        if escape:
            return value.replace('\$', '$')
        return value
    
    bug 
    opened by mmoallemi99 13
  • Changes django-environ to modify a copy of the environment

    Changes django-environ to modify a copy of the environment

    This prevents django-environ's use of os.environ making changes to the ACTUAL environment. All other behavior kept the same. This fixes issues with UWSGI emperor mode where the environment is persistent between vassal restarts leading to any variable set in a .env file becoming semi-permanent as django-environ won't overwrite existing environment settings.

    Instead of the old fix, which only copied the os.environ in read_env, this pull shallow copies os.environ inside env.init, meaning that we always have a copy of the environment whether we read an .env file or not.

    All tests passing.

    opened by mattaw 13
  • Test against Django 1.11

    Test against Django 1.11

    The >=1.11a1,<2.0 specifier will avoid having to adjust the version as the Django 1.11 pre-release cycle continues.

    Also stops testing Django master against Python 2, since they dropped support for it.

    opened by edmorley 13
  • can not override environment settings that already have value with a file

    can not override environment settings that already have value with a file

    I have

    env = environ.Env(
        DEBUG=(bool, False),
    )
    ENV_FILE = str(env.path('ENV_FILE', default='/'))
    if os.path.isfile(ENV_FILE):
        overrides = {'DATABASE_URL': os.environ.pop('DATABASE_URL', '')}
        env.read_env(env_file=ENV_FILE, **overrides)
    else:
        # unset if no file was found
        ENV_FILE = None
    

    Problem is that in my ENV_FILE, I want to set DATABASE_URL that already has a value when reading the ENV_FILE.

    But because def read_env(env_file=None, **overrides) uses setdefault(key, str(val)) this value can not be overwritten.

    Is it possible to extend def read_env with an extra boolean argument to decide whether or not to override existing environment variables?

    bug 
    opened by bmoelans 13
  • Release anytime soon?

    Release anytime soon?

    There has not been a new release since 2018, yet there is a substantial amount of work done in the develop branch. Will any of this be released soon?

    release 
    opened by lanshark 11
  • Add docker-style file variable support (fixes #189)

    Add docker-style file variable support (fixes #189)

    Docker (swarm) and Kubernetes are two widely used platforms that store their Secrets in tmpfs inside containers as individual files.

    These are a secure way to be able to share configuration data between containers, and having a way to access these in django-environ is useful.

    Here's a quote from the official Postgres docker hub image:

    As an alternative to passing sensitive information via environment variables, _FILE may be appended to some of the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:

    enhancement 
    opened by SmileyChris 10
  • default seems broken

    default seems broken

    Hi there,

    I've just updated from 0.4.4 to 0.4.5 and noticed a few unexpected behaviours with default. Presumably they relate to the casting changes that were introduced recently?

    # the key is in my env
    In [3]: env('GOOGLE_ANALYTICS_KEY')
    Out[3]: 'UA-123456-78'
    
    # I should have used a string as default here
    # but I would still expect these to return my key instead of False
    
    In [4]: env('GOOGLE_ANALYTICS_KEY', default=False)
    Out[4]: False
    
    In [7]: env('GOOGLE_ANALYTICS_KEY', default=True)
    Out[7]: False
    
    # these ones work as expected
    
    In [5]: env('GOOGLE_ANALYTICS_KEY', default='')
    Out[5]: 'UA-123456-78'
    
    In [6]: env('GOOGLE_ANALYTICS_KEY', default=None)
    Out[6]: 'UA-123456-78'
    

    Cheers, Matthieu

    bug 
    opened by mbonnefoy 10
  • Removed proxy variable feature. (#60)

    Removed proxy variable feature. (#60)

    Expanding variables automatically on a read is an anti-pattern. Variable expansion by the shell should only be done when the value is inserted into the environment, but the vlaue should be treated as opaque data. Any processing or interpretation of the variable should be done by the appliaction, not by the access method.

    help wanted 
    opened by mrogaski 9
  • Update testing matrix Django and Python versions

    Update testing matrix Django and Python versions

    • Stop testing on unsupported versions of Django (versions prior to 1.8 are no longer maintained).
    • Stop testing Django 1.9+ with Python 3.3 (only test against 1.8, the last version to support it).
    • Test the latest point release of each major Django version (rather than the initial release of each).
    • Test with Django 1.10b1 (this can be updated when the official version is released).
    • Test using the PyPy Python release.
    • Fix the AppVeyor test run (since the location of get-pip.py has changed).

    See individual commit messages for more details.

    opened by edmorley 9
  • Add option to overwrite existing environment variables in read_env

    Add option to overwrite existing environment variables in read_env

    This PR addresses issue #103. I've had this issue with the uwsgi touch-reload command. It won't pick up updates to .env files.

    In some use cases, the .env file should be the master, so an overwrite=True option will resolve the issue in this case.

    • All tests pass
    • Should be no performance penalty for current use (other than an additional function call)
    • Minor performance in overwrite use due to temp dict.

    The temp dict was needed since there is no dict.set(k,v) method. The lambda can't do dict[k] = v.

    enhancement 
    opened by kutenai 8
  • Bump actions/checkout from 3.0.2 to 3.3.0

    Bump actions/checkout from 3.0.2 to 3.3.0

    Bumps actions/checkout from 3.0.2 to 3.3.0.

    Release notes

    Sourced from actions/checkout's releases.

    v3.3.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3.2.0...v3.3.0

    v3.2.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3.1.0...v3.2.0

    v3.1.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3.0.2...v3.1.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.1.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    github_actions dependencies 
    opened by dependabot[bot] 1
  • Bump actions/setup-python from 4.0.0 to 4.4.0

    Bump actions/setup-python from 4.0.0 to 4.4.0

    Bumps actions/setup-python from 4.0.0 to 4.4.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Add support to install multiple python versions

    In scope of this release we added support to install multiple python versions. For this you can try to use this snippet:

        - uses: actions/[email protected]
          with:
            python-version: |
                3.8
                3.9
                3.10
    

    Besides, we changed logic with throwing the error for GHES if cache is unavailable to warn (actions/setup-python#566).

    Improve error handling and messages

    In scope of this release we added improved error message to put operating system and its version in the logs (actions/setup-python#559). Besides, the release

    v4.3.0

    • Update @​actions/core to 1.10.0 version #517
    • Update @​actions/cache to 3.0.4 version #499
    • Only use github.token on github.com #443
    • Improvement of documentation #477 #479 #491 #492

    Add check-latest input and bug fixes

    In scope of this release we add the check-latest input. If check-latest is set to true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the version will then be downloaded from python-versions repository. By default check-latest is set to false. For PyPy it will to try to reach https://downloads.python.org/pypy/versions.json

    Example of usage:

    steps:
      - uses: actions/[email protected]
      - uses: actions/[email protected]
        with:
          python-version: '3.9'
          check-latest: true
      - run: python --version
    

    Besides, it includes such changes as

    v4.1.0

    In scope of this pull request we updated actions/cache package as the new version contains fixes for caching error handling. Moreover, we added a new input update-environment. This option allows to specify if the action shall update environment variables (default) or not.

    Update-environment input

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    github_actions dependencies 
    opened by dependabot[bot] 1
  • help needed?

    help needed?

    hello @joke2k

    I would like to offer help, because we heavily use this package and we would be interested in its further development.

    It seems like right now you might not have so much time, hence: let me know if I can assist.

    cheers

    opened by andreasnuesslein 0
  • Secret support

    Secret support

    There is case when it is required to read envs from files e.g. kubernetes mounted secret volume:

        spec:
          ...
            volumeMounts:
              - name: webapp-secret
                mountPath: "/mnt/secrets"
                readOnly: true
            imagePullPolicy: Never
          ...
    

    I would be happy to see such enhancement!

    opened by guesswh0 0
  • Any plan to support embedded variables?

    Any plan to support embedded variables?

    I was wondering if there has been discussions/plans to support embedded variables in .env file. For example,

    # .env file with embedded variables
    LIB_PATH=/home/username/.lib
    GDAL_LIBRARY_PATH=${LIB_PATH}/osgeo/gdal304.dll
    GEOS_LIBRARY_PATH=${LIB_PATH}/osgeo/geos_c.dll
    

    I got used to the ${VAR_NAME} syntax as it is supported by docker-compose and python-dotenv among others. It would be great to get the same support in django-environ. I'm aware of the interpolate feature which covers a more limited use case.

    Would that be useful to anyone else?

    opened by sylvainletourneau 1
Releases(v0.9.0)
  • v0.9.0(Jun 15, 2022)

    Added

    • Added support for Postgresql cluster URI #355.
    • Added support for Django 4.0 #371.
    • Added support for prefixed variables #362.
    • Amended documentation.

    Deprecated

    • Env.unicode() is deprecated and will be removed in the next major release. Use Env.str() instead.

    Changed

    • Attach cause to ImproperlyConfigured exception #360.

    Fixed

    • Fixed _cast_urlstr unquoting #357.
    • Fixed documentation regarding unsafe characters in URLs #220.
    • Fixed environ.Path.__eq__() to compare paths correctly #86, #197.
    Source code(tar.gz)
    Source code(zip)
    django-environ-0.9.0.tar(310.00 KB)
    django_environ-0.9.0-py2.py3-none-any.whl(17.49 KB)
  • v0.8.1(Oct 20, 2021)

    Fixed

    • Fixed "Invalid line" spam logs on blank lines in env file #340.
    • Fixed memcache/pymemcache URL parsing for correct identification of connection type #337.

    Full diff: https://github.com/joke2k/django-environ/compare/v0.8.0...v0.8.1

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Oct 17, 2021)

    Added

    • Log invalid lines when parse .env file #283.
    • Added docker-style file variable support #189.
    • Added option to override existing variables with read_env #103, #249.
    • Added support for empty var with None default value #209.
    • Added pymemcache cache backend for Django 3.2+ #335.

    Fixed

    • Keep newline/tab escapes in quoted strings #296.
    • Handle escaped dollar sign in values #271.
    • Fixed incorrect parsing of DATABASES_URL for Google Cloud MySQL #294.

    Full diff: https://github.com/joke2k/django-environ/compare/v0.7.0...v0.8.0

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Sep 11, 2021)

    Added

    • Added support for negative float strings #160.
    • Added Elasticsearch5 to search scheme #297.
    • Added Elasticsearch7 to search scheme #314.
    • Added the ability to use bytes or str as a default value for Env.bytes().

    Fixed

    • Fixed links in the documentation.
    • Use default option in Env.bytes() #206.
    • Safely evaluate a string containing an invalid Python literal #200.

    Changed

    • Added 'Funding' and 'Say Thanks!' project urls on pypi.
    • Stop raising UserWarning if .env file isn't found. Log a message with INFO log level instead #243.
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Sep 4, 2021)

    Added

    • Python 3.9, 3.10 and pypy 3.7 are now supported.
    • Django 3.1 and 3.2 are now supported.
    • Added missed classifiers to setup.py.
    • Accept Python 3.6 path-like objects for read_env #106, #286.

    Fixed

    • Fixed various code linting errors.
    • Fixed typos in the documentation.
    • Added missed files to the package contents.
    • Fixed db_url_config to work the same for all postgres-like schemes #264, #268.

    Changed

    • Refactor tests to use pytest and follow DRY.
    • Moved CI to GitHub Actions.
    • Restructuring of project documentation.
    • Build and test package documentation as a part of CI pipeline.
    • Build and test package distribution as a part of CI pipeline.
    • Check MANIFEST.in in a source package for completeness as a part of CI pipeline.
    • Added pytest and coverage[toml] to setuptools' extras_require.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Aug 30, 2021)

    Added

    • Support for Django 2.1 & 2.2.
    • Added tox.ini targets.
    • Added secure redis backend URLs via rediss://.
    • Add cast=str to str() method.

    Fixed

    • Fixed misspelling in the documentation.

    Changed

    • Validate empty cache url and invalid cache schema.
    • Set long_description_content_type in setup.
    • Improved Django 1.11 database configuration support.
    Source code(tar.gz)
    Source code(zip)
  • v0.4.5(Jun 25, 2018)

    Added

    • Support for Django 2.0.
    • Support for smart casting.
    • Support PostgreSQL unix domain socket paths.
    • Tip: Multiple env files.

    Changed

    • Fix parsing option values None, True and False.
    • Order of importance of engine configuration indb_url_config.

    Removed

    • Remove django and six dependencies.
    Source code(tar.gz)
    Source code(zip)
  • v0.4.4(Aug 21, 2017)

    Added

    • Support for django-redis multiple locations (master/slave, shards).
    • Support for Elasticsearch2.
    • Support for Mysql-connector.
    • Support for pyodbc.
    • Add __contains__ feature to Environ class.

    Fixed

    • Fix Path subtracting.
    Source code(tar.gz)
    Source code(zip)
  • v0.4.3(Apr 19, 2017)

  • v0.4.2(Apr 13, 2017)

    Added

    • Confirm support for Django 1.11.
    • Support for Redshift database URL

    Changed

    • Fix uwsgi settings reload problem (#55)
    • Update support for django-redis urls (#109)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(Nov 13, 2016)

    Added

    • Add support for Django 1.10

    Changed

    • Fix for unsafe characters into URLs
    • Clarifying warning on missing or unreadable file. Thanks to @nickcatal
    • Fix support for Oracle urls
    • Fix support for django-redis
    Source code(tar.gz)
    Source code(zip)
  • v0.4(Sep 23, 2015)

    Added

    • New email schemes - smtp+ssl and smtp+tls (smtps would be deprecated)
    • Add tuple support. Thanks to @anonymouzz
    • Add LDAP url support for database. Thanks to django-ldapdb

    Changed

    • Fix non-ascii values (broken in Python 2.x)
    • redis_cache replaced by django_redis
    • Fix psql/pgsql url
    Source code(tar.gz)
    Source code(zip)
  • v0.3(Sep 4, 2021)

  • v0.3.1(Sep 19, 2015)

    Added

    • Added email as alias for email_url
    • Django 1.7 is now supported
    • Added LDAP scheme support for db_url_config

    Fixed

    • Fixed typos in the documentation
    • Fixed environ.Path.__add__ to correctly handle plus operator
    • Fixed environ.Path.__contains__ to correctly work on Windows
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Apr 2, 2014)

Owner
Daniele Faraglia
Web-native developer, UK based Self-employed
Daniele Faraglia
Read configuration settings from python configuration files.

Maison Read configuration settings from python configuration files. Motivation When developing a python application, e.g a command-line tool, it can b

9 Jan 04, 2023
Event Coding for the HV Protocol MEG datasets

Scripts for QA and trigger preprocessing of NIMH HV Protocol Install pip install git+https://github.com/nih-megcore/hv_proc Usage hv_process.py will

2 Nov 14, 2022
Configuration for Python planets

Configuration for Python planets

Python 127 Dec 16, 2022
This Ivy plugin adds support for TOML file headers.

This Ivy plugin adds support for TOML file headers as an alternative to YAML.

Darren Mulholland 1 Nov 09, 2021
A modern simfile parsing & editing library for Python 3

A modern simfile parsing & editing library for Python 3

ash garcia 38 Nov 01, 2022
A YAML validator for Programming Historian lessons.

phyaml A simple YAML validator for Programming Historian lessons. USAGE: python3 ph-lesson-yaml-validator.py lesson.md The script automatically detect

Riva Quiroga 1 Nov 07, 2021
KConfig Browser is a graphical application which allows you to modify KDE configuration files found in ~/.config

kconfig_browser KConfig Browser is a graphical application which allows you to modify KDE configuration files found in ~/.config Screenshot Why I crea

11 Sep 15, 2022
Strict separation of config from code.

Python Decouple: Strict separation of settings from code Decouple helps you to organize your settings so that you can change parameters without having

Henrique Bastos 2.3k Dec 30, 2022
A Python library to parse PARI/GP configuration and header files

pari-utils A Python library to parse PARI/GP configuration and header files. This is mainly used in the code generation of https://github.com/sagemath

Sage Mathematical Software System 3 Sep 18, 2022
Napalm-vs-openconfig - Comparison of NAPALM and OpenConfig YANG with NETCONF transport

NAPALM vs NETCONF/OPENCONFIG Abstracts Multi vendor network management and autom

Anton Karneliuk 1 Jan 17, 2022
Python 3+ compatible port of the configobj library

configobj Python 3+ compatible port of the configobj library. Documentation You can find a full manual on how to use ConfigObj at readthedocs. If you

Differently Sized Kittens 288 Dec 14, 2022
Configuration Extractor for EXE4J PE files

EXE4J Configuration Extractor This script helps reverse engineering Portable Executable files created with EXE4J by extracting their configuration dat

Karsten Hahn 6 Jun 29, 2022
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.

Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support, based on awesome and lightweight pyhocon parsing library.

Teo Stocco 62 Dec 23, 2022
ConfZ is a configuration management library for Python based on pydantic.

ConfZ – Pydantic Config Management ConfZ is a configuration management library for Python based on pydantic. It easily allows you to load your configu

Zühlke 164 Dec 27, 2022
Load Django Settings from Environmental Variables with One Magical Line of Code

DjEnv: Django + Environment Load Django Settings Directly from Environmental Variables features modify django configuration without modifying source c

Daniel J. Dufour 28 Oct 01, 2022
Dynamic Django settings.

Constance - Dynamic Django settings A Django app for storing dynamic settings in pluggable backends (Redis and Django model backend built in) with an

Jazzband 1.5k Jan 04, 2023
sqlconfig: manage your config files with sqlite

sqlconfig: manage your config files with sqlite The problem Your app probably has a lot of configuration in git. Storing it as files in a git repo has

Pete Hunt 4 Feb 21, 2022
Dag-bakery - Dag Bakery enables the capability to define Airflow DAGs via YAML.

DAG Bakery - WIP 🔧 dag-bakery aims to simplify our DAG development by removing all the boilerplate and duplicated code when defining multiple DAG cro

Typeform 2 Jan 08, 2022
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Django-environ django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables. import envi

Daniele Faraglia 2.7k Jan 03, 2023
Pydantic-ish YAML configuration management.

Pydantic-ish YAML configuration management.

Dribia Data Research 18 Oct 27, 2022