django-dotenv
foreman reads from .env. manage.py doesn't. Let's fix that.
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-dotenvuv
uv add django-dotenvpoetry
poetry add django-dotenvInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
django-configurationsOrganizes Django settings using composable…
permissive · top 15,000 on PyPI
python-dotenvReads key-value pairs from a .env file and sets…
permissive · top 100 on PyPI
load-dotenvAutomatically loads environment variables from…
permissive · top 15,000 on PyPI
dotenvLoads environment variables from a .env file…
unclear · top 5,000 on PyPI
poetry-dotenv-pluginA Poetry plugin that automatically loads…
permissive · top 15,000 on PyPI
pytest-dotenvA pytest plugin that automatically loads…
permissive · top 5,000 on PyPI
dj-staticWraps a WSGI application to serve static files…
permissive · top 15,000 on PyPI
django-split-settingsSplits Django settings across multiple files…
permissive · top 15,000 on PyPI
dotenv-linterLints `.env` files for consistency violations…
permissive · top 15,000 on PyPI
pydantic-settingsLoads and validates application settings from…
permissive · top 100 on PyPI