skillfed

django-dotenv

foreman reads from .env. manage.py doesn't. Let's fix that.

django-dotenv v1.4.2 239.9K downloads/30d#8,914 on PyPI577
Permissive license Abandoned released

What it is and what it does

django-dotenv adds a single function call to load environment variables from a .env file before Django initializes. You add dotenv.read_dotenv() at the top of manage.py or wsgi.py, and the package reads your .env file and populates os.environ, letting you follow 12-factor app principles without editing Django's core files. It has no runtime dependencies and works by wrapping the standard dotenv module.

The package is marked production-stable but abandoned: the last release was in 2017 and the repository's final commit was in 2021. It was tested on Python 3.5, 3.6, 3.7 and 3.8. Because it has not been updated since then, compatibility with modern Django or Python versions is unknown and unsupported.

Use it for:

  • Load database credentials and API keys from .env during local Django development without committing secrets to version control.
  • Configure Django settings via environment variables in Docker containers or cloud deployments.
  • Set up WSGI applications to read .env files automatically on startup without modifying application code.
  • Manage different environment configurations by switching .env files at deployment time.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Loads environment variables from a .env file into Django's manage.py and WSGI applications before Django initializes.

Yes, if your Django project uses Python 3.5–3.8 and corresponding Django versions from that era. The package is simple, dependency-free, and solves a real problem. No, if you are using modern Python or Django versions, because the package is abandoned and untested on those releases. Verify compatibility with your exact versions before installing.

Install

django-dotenv on PyPI

pip

pip install django-dotenv

uv

uv add django-dotenv

poetry

poetry add django-dotenv

Installing django-dotenv

Before you install

Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was in 2017 and last commit in 2021—so it will not receive bug fixes or security updates.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.

Quickstart

pip install django-dotenv

# In manage.py:
import dotenv

if __name__ == "__main__":
    dotenv.read_dotenv()
    # ... rest of manage.py

Requires dotenv module to be available; conflicts with python-dotenv if both are installed.

Verify before relying

  • Whether the package works reliably with Django versions and Python releases beyond those tested (3.5, 3.6, 3.7, 3.8).
  • Compatibility implications if both django-dotenv and the similarly-named python-dotenv package are installed together.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 3,168 days since the last release
Last repo commit
First released
Downloads 239,863/month — #8,914 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_dotenv-1.4.2-py2.py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.4Topic :: Internet :: WWW/HTTP

Tags

django environment variables .envload .env file djangodjango-dotenv manage.pyenvironment configuration django12-factor app djangodotenv django integration.env file django wsgi
django-integrationenvironment-configabandoned

More WWW/HTTP packages