dj-email-url
Use an URL to configure email backend settings in your Django Application.
What it is and what it does
dj-email-url parses email backend configuration from URL-style environment variables and returns a dictionary of Django EMAIL_* settings. It eliminates the need to manually set EMAIL_HOST, EMAIL_PORT, EMAIL_USE_TLS, and related settings by encoding them into a single EMAIL_URL variable, following the 12-factor application pattern.
The package supports multiple backends: SMTP (local or remote with STARTTLS), SMTP-over-SSL, file-based, console, in-memory, and dummy backends. It handles URL percent-encoding for special characters in passwords and allows optional query parameters to set EMAIL_TIMEOUT, SERVER_EMAIL, and DEFAULT_FROM_EMAIL. With no runtime dependencies, it integrates directly into Django settings.py with minimal setup.
Use it for:
- Store email configuration in environment variables for development, staging, and production without code changes
- Configure SendGrid or other third-party SMTP relays by parsing submission:// URLs with credentials
- Use file or console backends for local development by switching EMAIL_URL without modifying settings
- Set email timeout and origin addresses (SERVER_EMAIL, DEFAULT_FROM_EMAIL) via query parameters in a single URL
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Configures Django email backends from environment variables using URL-style connection strings, following the 12-factor app pattern.
Yes, if you use Django and want to externalize email configuration to environment variables. The package is stable, dependency-free, and permissively licensed. However, note that maintenance is dormant (no release since September 2022); verify compatibility with your Django and Python versions before adopting, especially if you require recent Django LTS releases.
Install
dj-email-url on PyPI
pip
pip install dj-email-urluv
uv add dj-email-urlpoetry
poetry add dj-email-urlInstalling dj-email-url
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 1420 days ago, though the repository remains active with a recent commit in June 2024.
License in practice
Licensed under BSD-2-Clause (source code), CC-BY-4.0 (documentation), and CC0-1.0 (config files). Permissive terms allow commercial use with minimal restrictions.
Quickstart
import dj_email_url
email_config = dj_email_url.config() # reads EMAIL_URL env var
# or parse directly:
email_config = dj_email_url.parse('smtp://user:pass@localhost')
vars().update(email_config) # apply to Django settings
Verify before relying
- Whether the package works with Django versions released after 2022-09-24
- Compatibility with Python 3.11+ (classifiers list only up to 3.10)
Package facts
| License | BSD-2-Clause AND CC-BY-4.0 AND CC0-1.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,420 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 220,339/month — #9,303 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dj_email_url-1.0.6-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
django-naomidjango-naomi is a Django email backend that…
permissive · top 15,000 on PyPI
django-environLoads and parses environment variables from…
permissive · top 5,000 on PyPI
Flask-MailFlask-Mail adds email-sending functionality to…
permissive · top 5,000 on PyPI
django-anymailSends and receives email in Django through…
permissive · top 5,000 on PyPI
django-celery-emailRoutes Django email sending through Celery task…
permissive · top 15,000 on PyPI
django-sesA Django email backend that routes outgoing…
permissive · top 5,000 on PyPI
django-post_officeDjango Post Office queues and sends emails…
permissive · top 15,000 on PyPI
emailsBuild and send HTML and plain-text emails with…
permissive · top 15,000 on PyPI
django-templated-mailSends Django emails using template files…
permissive · top 15,000 on PyPI
dsnparseParses DSN (Data Source Name) connection URL…
permissive · top 15,000 on PyPI