skip to navigation
skip to content

Not Logged In

django-getenv 1.3.1

Read settings from environment variables.

A quick’n’easy way to use environment variables in your Django (and Python) projects.

  • Free software: BSD license


If you’re using django-dotenv to get the most out of your .env file, you want to use the values there in your Django 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.


pip install django-getenv


In your file (or equivalent), add:

from getenv import env

Then to read in your environment variables, do this:


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 and dj-database-url.


1.3.1 (2014-03-07)

  • Fix HISTORY.rst
  • Remove Python 2.6 from Travis configuration

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
File Type Py Version Uploaded on Size
django-getenv-1.3.1.tar.gz (md5) Source 2014-03-07 5KB
django_getenv-1.3.1-py2.py3-none-any.whl (md5) Python Wheel 2.7 2014-03-07 4KB
  • Downloads (All Versions):
  • 106 downloads in the last day
  • 1084 downloads in the last week
  • 3344 downloads in the last month