Read settings from environment variables.
Project description
=============
django-getenv
=============
.. image:: https://badge.fury.io/py/django-getenv.png
:target: http://badge.fury.io/py/django-getenv
.. image:: https://travis-ci.org/schwuk/django-getenv.png?branch=master
:target: https://travis-ci.org/schwuk/django-getenv
.. image:: https://pypip.in/d/django-getenv/badge.png
:target: https://pypi.python.org/pypi/django-getenv
A quick'n'easy way to use environment variables in your Django (and
Python) projects.
* Free software: BSD license
Introduction
------------
If you're using
`django-dotenv <https://github.com/jacobian/django-dotenv>`__ to get the
most out of your ``.env`` file, you want to use the values there in your
`Django <https://www.djangoproject.com/>`__ project's settings.
It will convert boolean, integer and float values to their native Python
types.
There's nothing here that is Django specific, but I'm using it with
Django so that's what I've called it.
Installation
------------
::
pip install django-getenv
Usage
-----
In your ``settings.py`` file (or equivalent), add:
::
from getenv import env
Then to read in your environment variables, do this:
::
SECRET_KEY = env("SECRET_KEY")
If you want to provide a default (in case the environment variable isn't
set), try:
::
SECRET_KEY = env("SECRET_KEY", "a_secret_key")
For best results, mix with
`django-dotenv <https://github.com/jacobian/django-dotenv>`__ and
`dj-database-url <https://github.com/kennethreitz/dj-database-url>`__.
History
-------
1.3.0 (2014-03-06)
++++++++++++++++++
* Improved (cookiecutter-pypackage style) project layout
1.2.0 (2014-01-14)
++++++++++++++++++
* Specify an environment variable as required, and raise ImproperlyConfigured
exception if not present (#2)
1.1.0 (2013-07-24)
++++++++++++++++++
* Marked as "5 - Production/Stable" instead of "4 - Beta"
* Cleaned up README
* Added CHANGES
1.0.0 (2013-07-19)
++++++++++++++++++
* Initial release
django-getenv
=============
.. image:: https://badge.fury.io/py/django-getenv.png
:target: http://badge.fury.io/py/django-getenv
.. image:: https://travis-ci.org/schwuk/django-getenv.png?branch=master
:target: https://travis-ci.org/schwuk/django-getenv
.. image:: https://pypip.in/d/django-getenv/badge.png
:target: https://pypi.python.org/pypi/django-getenv
A quick'n'easy way to use environment variables in your Django (and
Python) projects.
* Free software: BSD license
Introduction
------------
If you're using
`django-dotenv <https://github.com/jacobian/django-dotenv>`__ to get the
most out of your ``.env`` file, you want to use the values there in your
`Django <https://www.djangoproject.com/>`__ project's settings.
It will convert boolean, integer and float values to their native Python
types.
There's nothing here that is Django specific, but I'm using it with
Django so that's what I've called it.
Installation
------------
::
pip install django-getenv
Usage
-----
In your ``settings.py`` file (or equivalent), add:
::
from getenv import env
Then to read in your environment variables, do this:
::
SECRET_KEY = env("SECRET_KEY")
If you want to provide a default (in case the environment variable isn't
set), try:
::
SECRET_KEY = env("SECRET_KEY", "a_secret_key")
For best results, mix with
`django-dotenv <https://github.com/jacobian/django-dotenv>`__ and
`dj-database-url <https://github.com/kennethreitz/dj-database-url>`__.
History
-------
1.3.0 (2014-03-06)
++++++++++++++++++
* Improved (cookiecutter-pypackage style) project layout
1.2.0 (2014-01-14)
++++++++++++++++++
* Specify an environment variable as required, and raise ImproperlyConfigured
exception if not present (#2)
1.1.0 (2013-07-24)
++++++++++++++++++
* Marked as "5 - Production/Stable" instead of "4 - Beta"
* Cleaned up README
* Added CHANGES
1.0.0 (2013-07-19)
++++++++++++++++++
* Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-getenv-1.3.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for django_getenv-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b33b52a023dd3e319d0056b75e86edb50d16ea678a352df7a878a6271121c13a |
|
MD5 | 38367fb4deac9d1eee73e3753785ecf3 |
|
BLAKE2b-256 | 4273fc087347cc885ef840ece478c3029ad5159cfa98d74714eab9a0772a6a72 |