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 <[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

Issues
  • 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
  • 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
  • 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
  • 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
  • Add DISABLE_SERVER_SIDE_CURSORS to _DB_BASE_OPTIONS

    Add DISABLE_SERVER_SIDE_CURSORS to _DB_BASE_OPTIONS

    • https://docs.djangoproject.com/en/1.11/ref/settings/#disable-server-side-cursors
    • closes #159
    opened by fdemmer 11
  • Add support for mssql connector

    Add support for mssql connector

    closes #156

    opened by Jafnee 11
  • 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
  • ModuleNotFoundError: No module named 'environ' :: With celery and supervisor

    ModuleNotFoundError: No module named 'environ' :: With celery and supervisor

    When Celery run background at that time I get ModuleNotFoundError: No module named 'environ', can any guide me how to setup this in production

    invalid 
    opened by Yogeshddjango 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
  • Bump actions/setup-python from 2.2.2 to 2.3.1

    Bump actions/setup-python from 2.2.2 to 2.3.1

    Bumps actions/setup-python from 2.2.2 to 2.3.1.

    Release notes

    Sourced from actions/setup-python's releases.

    Update actions/cache version to 1.0.8

    We have updated actions/cache dependency version to 1.0.8 to support 10GB cache upload

    Support caching dependencies

    This release introduces dependency caching support (actions/setup-python#266)

    Caching dependencies.

    The action has a built-in functionality for caching and restoring pip/pipenv dependencies. The cache input is optional, and caching is turned off by default.

    Besides, this release introduces dependency caching support for mono repos and repositories with complex structure.

    By default, the action searches for the dependency file (requirements.txt for pip or Pipfile.lock for pipenv) in the whole repository. Use the cache-dependency-path input for cases when you want to override current behaviour and use different file for hash generation (for example requirements-dev.txt). This input supports wildcards or a list of file names for caching multiple dependencies.

    Caching pip dependencies:

    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        python-version: '3.9'
        cache: 'pip'
    - run: pip install -r requirements.txt
    - run: pip test
    

    Caching pipenv dependencies:

    steps:
    - uses: actions/[email protected]
    - name: Install pipenv
      run: pipx install pipenv
    - uses: actions/[email protected]
      with:
        python-version: '3.9'
        cache: 'pipenv'
    - run: pipenv install
    - run: pipenv test
    

    Change dependency file:

    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        python-version: '3.9'
        cache: 'pip'
        cache-dependency-path: '**/requirements-dev.txt'
    - run: pip install -r subdirectory/requirements-dev.txt
    - run: pip test
    </tr></table> 
    

    ... (truncated)

    Commits
    • f382193 Update @​actions/cache version to 1.0.8 (#283)
    • 3ef38b8 Create ADR for integrating cache functionality to setup-python action (#247)
    • 0066b88 Add a workflow to release a new version of the action (#274)
    • 280924f Implementation of python's caching (#266)
    • 52636cf Fix consistency in README (#250)
    • ca5c590 Update version for setup-python in package.json (#264)
    • feeaa3b Add issue and pull request templates (#258)
    • 002b1e4 Change python version for pypy in workflow files (#259)
    • d12543a Merge pull request #252 from dmitry-shibanov/v-dmshib/update-dependencies
    • 4aa563b update dependencies
    • Additional commits viewable in compare view

    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
  • Support for behaviors of pylibmc

    Support for behaviors of pylibmc

    I am using django-environ and pylibmc as backend. It would be nice to be able to set behaviors directly in the env. Something like: CACHE_URL=pymemcache://127.0.0.1:11211?TIMEOUT=6000&BEHAVIOR:ketama=1&BEHAVIOR:remove_failed=1&BEHAVIOR:retry_timeout=1&BEHAVIOR:dead_timeout=60

    CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
            'LOCATION': '127.0.0.1:11211',
            'TIMEOUT': 6000,
            'OPTIONS': {
                'behaviors': {
                    'ketama': 1,
                    'remove_failed': 1,
                    'retry_timeout': 1,
                    'dead_timeout': 60
                }
            }
        }
    }
    
    enhancement 
    opened by cic79 0
  • Support for flask or fastapi

    Support for flask or fastapi

    Do we currently have any support for flask or fastapi? is it possible to use this lib for these two frameworks?

    question 
    opened by dyohan9 1
  • Support for mssql-django

    Support for mssql-django

    There is an official django-mssql-backend port by Microsoft in the making. To use it you have to provide "mssql" as the engine. https://github.com/microsoft/mssql-django#installation

    Currently django-environ maps "mssql" to "sql_server.pyodbc". https://github.com/joke2k/django-environ/pull/157

    Don't know what the solution is, but it would be nice if there's a way to configure mssql-django in the next release.

    enhancement 
    opened by valentinschabschneider 1
  • Feature Request: Warning if an env.path does not exist

    Feature Request: Warning if an env.path does not exist

    Hello,

    I recently did a very dumb thing and think it might be worth it if this library caught the issue, just in case someone else also makes my mistake.

    I put this in my '.env' file:

    MEDIA_ROOT="/some/path/"  # Put ... here
    

    Now obviously this spits out a garbage path, and my first reaction is to check for it. However, this would be a perfectly valid path:

    MEDIA_ROOT="My Media"/#Crazy_file/
    

    So, instead of trying to do complicated parsing, why not just check if the Path exists at all and if it doesn't then spit out a warning?

    enhancement 
    opened by EmperorArthur 0
  • Django improperly configured error if secret key begins with a dollar sign character

    Django improperly configured error if secret key begins with a dollar sign character

    I've come across this error which only seems to occur when using the django-environ package to read a SECRET_KEY from a .env file.

    My .env file (with a generated secret key using the get_random_secret_key module from django)

    SECRET_KEY=$q*eo+c&2!)u9^tpd6f=0szxt6+th!j^#z9$1mh!kyen*36($t)

    My settings.py file

    import environ
    env = environ.Env()
    environ.Env.read_env()
    
    SECRET_KEY = env('SECRET_KEY')
    

    Running this code will generate the following error

    django.core.exceptions.ImproperlyConfigured: Set the q*eo+c&2!)u9^tpd6f=0szxt6+th!j^#z9$1mh!kyen*36($t) environment variable

    Even if I surround the secret key value with single or double quotes the error will still occur.

    This error does not occur if I use a different python environment file package such as python-dotenv to read the same .env file.

    The django-environ package seems to think the SECRET_KEY value is an environment variable itself. I know this is a very niche situation as this secret key that I generated just happened to have a leading '$' character but it may catch people out if they're generating their secret key with a script. The error occurs for any secret key value that starts with a '$'. Full stack trace:

    Traceback (most recent call last):
      File "/opt/anaconda3/envs/django_py/lib/python3.9/site-packages/environ/environ.py", line 273, in get_value
        value = self.ENVIRON[var]
      File "/opt/anaconda3/envs/django_py/lib/python3.9/os.py", line 679, in __getitem__
        raise KeyError(key) from None
    KeyError: 'q*eo+c&2!)u9^tpd6f=0szxt6+th!j^#z9$1mh!kyen*36($t)'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/danieloram/Desktop/test_env/environ_secret_key.py", line 10, in <module>
        SECRET_KEY = env('SECRET_KEY')
      File "/opt/anaconda3/envs/django_py/lib/python3.9/site-packages/environ/environ.py", line 123, in __call__
        return self.get_value(var, cast=cast, default=default, parse_default=parse_default)
      File "/opt/anaconda3/envs/django_py/lib/python3.9/site-packages/environ/environ.py", line 284, in get_value
        value = self.get_value(value, cast=cast, default=default)
      File "/opt/anaconda3/envs/django_py/lib/python3.9/site-packages/environ/environ.py", line 277, in get_value
        raise ImproperlyConfigured(error_msg)
    django.core.exceptions.ImproperlyConfigured: Set the q*eo+c&2!)u9^tpd6f=0szxt6+th!j^#z9$1mh!kyen*36($t) environment variable
    

    django version: 3.0.3

    django-environ version: 0.4.5

    bug 
    opened by DanielOram 2
  • Reading .pgpass for a Postgresql connection

    Reading .pgpass for a Postgresql connection

    Is there a way to read the .pgpass file for the database connection? Setting just DJANGO_DATABASE_URL=postgres://host/database without credentials would be very handy.

    https://www.postgresql.org/docs/12/libpq-pgpass.html

    enhancement 
    opened by krzysztofjeziorny 1
  • Clearly specify `.env` file syntax (not like Docker, not like Bash; it's something else)

    Clearly specify `.env` file syntax (not like Docker, not like Bash; it's something else)

    The supported syntax of the .env file needs to be better specified (possibly as part of #88, but this may be a bigger issue than just that ticket).

    Reading the regex-based parsing, it's clear that django-environ tries to support something bash-ish - it strips leading export declarations at the beginning of the line, and does some rudimentary quote processing (just stripping matching ' or " at the beginning and end).

    However:

    • This differs from Docker's behavior for .env files. Docker does no quote parsing, so beginning/trailing quotes are considered as part of the value. An .env file that works in django-environ may not work in Docker. An example failure: a quoted JSON string like VAR='{"key": "value"}' will work in django-environ, but fail if Docker has parsed .env and populated the environment with it; the wrapping ' will be retained and not be valid json.
    • The rudimentary quote parsing is pathological in some cases (e.g. #165), and certainly doesn't support all of the quoting complexity found in bash. A valid bash quoting syntax will not always work for django-environ.

    In sum, the current behavior is:

    • Variables are expressed as VAR=VAL in single lines.
    • Beginning export keywords are stripped.
    • If VAL is wrapped in single or double quotes, those are stripped; but no further resolution of internal quoting structure is done.

    Expecting a single .env file to successfully target more than one of Docker, django-environ, or bash is looking for trouble; care must be taken for what other contexts populate the environment from .env before django-environ runs. Docker-parity can be achieved by avoiding all wrapping quotes in the .env values, so long as no value requires wrapping quotes as part of its content. Bash parity is probably not possible without using a bash interpreter to parse the file.

    documentation 
    opened by yourcelf 2
  • MSSQL 17 driver doesnt work

    MSSQL 17 driver doesnt work

    db_url only seems to be looking for mssql 13 driver

    enhancement 
    opened by asreenu 1
  • Add support for MQTT URI scheme

    Add support for MQTT URI scheme

    opened by fkromer 0
Releases(v0.8.1)
  • 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.3(Sep 4, 2021)

  • 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.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
The best way to have DRY Django forms. The app provides a tag and filter that lets you quickly render forms in a div format while providing an enormous amount of capability to configure and control the rendered HTML.

django-crispy-forms The best way to have Django DRY forms. Build programmatic reusable layouts out of components, having full control of the rendered

null 4.4k Dec 2, 2021
A Django web application that allows you to be in the loop about everything happening in your neighborhood.

A Django web application that allows you to be in the loop about everything happening in your neighborhood. From contact information of different handyman to meeting announcements or even alerts.

Kennedy Ngugi Mwaura 2 Nov 7, 2021
Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.

Django-Audiofield Description: Django Audio Management Tools Maintainer: Areski Contributors: list of contributors Django-Audiofield is a simple app t

Areski Belaid 160 Oct 31, 2021
pytest-django allows you to test your Django project/applications with the pytest testing tool.

pytest-django allows you to test your Django project/applications with the pytest testing tool.

pytest-dev 960 Nov 25, 2021
Rosetta is a Django application that eases the translation process of your Django projects

Rosetta Rosetta is a Django application that facilitates the translation process of your Django projects. Because it doesn't export any models, Rosett

Marco Bonetti 866 Dec 2, 2021
A Django app that allows visitors to interact with your site as a guest user without requiring registration.

django-guest-user A Django app that allows visitors to interact with your site as a guest user without requiring registration. Largely inspired by dja

Julian Wachholz 9 Dec 2, 2021
django-idom allows Django to integrate with IDOM

django-idom allows Django to integrate with IDOM, a package inspired by ReactJS for creating responsive web interfaces in pure Python.

null 11 Nov 26, 2021
System checks for your project's environment.

django-version-checks System checks for your project's environment. Requirements Python 3.6 to 3.9 supported. Django 2.2 to 3.2 supported. Are your te

Adam Johnson 28 Nov 25, 2021
A simple Django dev environment setup with docker for demo purposes for GalsenDev community

GalsenDEV Docker Demo This is a basic Django dev environment setup with docker and docker-compose for a GalsenDev Meetup. The main purposes was to mak

null 3 Jul 3, 2021
Stream Framework is a Python library, which allows you to build news feed, activity streams and notification systems using Cassandra and/or Redis. The authors of Stream-Framework also provide a cloud service for feed technology:

Stream Framework Activity Streams & Newsfeeds Stream Framework is a Python library which allows you to build activity streams & newsfeeds using Cassan

Thierry Schellenbach 4.6k Nov 24, 2021
Simple yet powerful and really extendable application for managing a blog within your Django Web site.

Django Blog Zinnia Simple yet powerful and really extendable application for managing a blog within your Django Web site. Zinnia has been made for pub

Julien Fache 2k Nov 23, 2021
Use Database URLs in your Django Application.

DJ-Database-URL This simple Django utility allows you to utilize the 12factor inspired DATABASE_URL environment variable to configure your Django appl

Jacob Kaplan-Moss 1.2k Dec 1, 2021
Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project

Django URL Shortener Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project Install this package to your Dja

Rishav Sinha 4 Nov 18, 2021
django Filer is a file management application for django that makes handling of files and images a breeze.

django Filer is a file management application for django that makes handling of files and images a breeze.

django CMS Association 1.5k Nov 28, 2021
DRF_commands is a Django package that helps you to create django rest framework endpoints faster using manage.py.

DRF_commands is a Django package that helps you to create django rest framework endpoints faster using manage.py.

Mokrani Yacine 1 Nov 11, 2021
Get inside your stronghold and make all your Django views default login_required

Stronghold Get inside your stronghold and make all your Django views default login_required Stronghold is a very small and easy to use django app that

Mike Grouchy 373 Nov 25, 2021
A Django app to initialize Sentry client for your Django applications

Dj_sentry This Django application intialize Sentry SDK to your Django application. How to install You can install this packaging by using: pip install

Gandi 1 Nov 26, 2021
Django application and library for importing and exporting data with admin integration.

django-import-export django-import-export is a Django application and library for importing and exporting data with included admin integration. Featur

null 2.3k Dec 2, 2021
A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1k Nov 24, 2021