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:password@localhost: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 <[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/setup-python@v4
          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/checkout@v3
      - uses: actions/setup-python@v4
        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
environs is a Python library for parsing environment variables.

environs: simplified environment variable parsing environs is a Python library for parsing environment variables. It allows you to store configuration

Steven Loria 920 Jan 4, 2023
A set of Python scripts and notebooks to help administer and configure Workforce projects.

Workforce Scripts A set of Python scripts and notebooks to help administer and configure Workforce projects. Notebooks Several example Jupyter noteboo

Esri 75 Sep 9, 2022
Inject your config variables into methods, so they are as close to usage as possible

Inject your config variables into methods, so they are as close to usage as possible

GDWR 7 Dec 14, 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 1, 2022
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

null 11 Sep 15, 2022
Python YAML Environment (ymlenv) by Problem Fighter Library

In the name of God, the Most Gracious, the Most Merciful. PF-PY-YMLEnv Documentation Install and update using pip: pip install -U PF-PY-YMLEnv Please

Problem Fighter 2 Jan 20, 2022
An application pulls configuration information from JSON files generated

AP Provisioning Automation An application pulls configuration information from JSON files generated by Ekahau and then uses Netmiko to configure the l

Cisco GVE DevNet Team 1 Dec 17, 2021
A small example project for efficiently configuring a Python application with YAMLs and the CLI

Hydra Example Project for Python A small example project for efficiently configuring a Python application with YAMLs and the CLI. Why should I care? A

Florian Wilhelm 4 Dec 31, 2022
Flexible Python configuration system. The last one you will ever need.

OmegaConf Description Project Code quality Docs and support OmegaConf is a hierarchical configuration system, with support for merging configurations

Omry Yadan 1.4k Jan 2, 2023
🤫 Easily manage configs and secrets in your Python projects (with CLI support)

Installation pip install confidential How does it work? Confidential manages secrets for your project, using AWS Secrets Manager. First, store a secr

Candid™️ 63 Oct 30, 2022
Sync any your configuration file to remote. Currently only support gist.

Sync your configuration to remote, such as vimrc. You can use EscSync to manage your configure of editor, shell, etc.

Me1onRind 0 Nov 21, 2022
Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards and optional settings files.

Organize Django settings into multiple files and directories. Easily override and modify settings. Use wildcards in settings file paths and mark setti

Nikita Sobolev 942 Jan 5, 2023
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 4, 2023
A helper for organizing Django project settings by relying on well established programming patterns.

django-configurations django-configurations eases Django project configuration by relying on the composability of Python classes. It extends the notio

Jazzband 955 Jan 5, 2023
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 3, 2023
This script allows you to retrieve all functions / variables names of a Python code, and the variables values.

Memory Extractor This script allows you to retrieve all functions / variables names of a Python code, and the variables values. How to use it ? The si

Venax 2 Dec 26, 2021
Generates all variables from your .tf files into a variables.tf file.

tfvg Generates all variables from your .tf files into a variables.tf file. It searches for every var.variable_name in your .tf files and generates a v

null 1 Dec 1, 2022
A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.

ConfigArgParse Overview Applications with more than a handful of user-settable options are best configured through a combination of command line args,

null 634 Dec 22, 2022
django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing

django-dashing django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project.

talPor Solutions 703 Dec 22, 2022
This is a package that allows you to create a key-value vault for storing variables in a global context

This is a package that allows you to create a key-value vault for storing variables in a global context. It allows you to set up a keyring with pre-defined constants which act as keys for the vault. These constants are then what is stored inside the vault. A key is just a string, but the value that the key is mapped to can be assigned to any type of object in Python. If the object is serializable (like a list or a dict), it can also be writen to a JSON file You can then use a decorator to annotate functions that you want to have use this vault to either store return variables in or to extract variables to be used as input for the function.

Data Ductus 2 Dec 14, 2022