skillfed

dj-email-url

Use an URL to configure email backend settings in your Django Application.

dj-email-url v1.0.6 220.3K downloads/30d#9,303 on PyPI64
Permissive license BSD-2-Clause AND CC-BY-4.0 AND CC0-1.0 DORMANT released

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-url

uv

uv add dj-email-url

poetry

poetry add dj-email-url

Installing 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

Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

django email configuration urlenvironment variable email settings12factor email backenddjango smtp url parseremail backend from env
django-config12factor

More Python Modules packages