$npx skillfedfor your agent

dj-database-url

Use Database URLs in your Django Application.

Worth itPyPI Python ModulesReleased Feb 20268.5M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — dj_database_url-3.1.2-py3-none-any.whl
v3.1.2 · released 2026-02-19 · Python >=3.10 · 1 runtime deps: django

Yes. This is a stable, actively maintained utility with zero known vulnerabilities, low install friction, and broad database backend support. It directly solves the common problem of externalizing database configuration in Django applications and is widely used in containerized and cloud-deployed environments. Install it if you use Django and want to follow 12factor principles for database configuration.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires DATABASE_URL environment variable to be set, or a default URL passed to config(); special characters in URLs must be percent-encoded.
  • Low friction: single dependency on django, wheel-only distribution, actively maintained with recent commits.
  • Supports current Python versions (3.10–3.14) and Django 4.2 through 6.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause (permissive): you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

last release 2026-02-19 (176 days) · last repo commit 2026-08-10 · 1,572 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,506,063 downloads/mo, #1,617 on PyPI

Verify before relying

import dj_database_url

DATABASES = {
    'default': dj_database_url.config(
        conn_max_age=600,
        conn_health_checks=True,
    )
}
  • Whether custom backend registration persists across application reloads or requires per-request setup.
  • Performance impact of connection health checks on request latency in high-throughput scenarios.
Same gist for agents: .md · .json

What it is and what it does

dj-database-url is a lightweight utility that converts DATABASE_URL environment variables into Django database configuration dictionaries. It implements the 12factor pattern for backing services, allowing you to externalize database connection details into environment variables rather than hardcoding them in settings.py. The package handles URL parsing for multiple database engines—PostgreSQL, MySQL, Oracle, SQLite, PostGIS, Redshift, CockroachDB, Timescale, and others—and automatically maps them to the correct Django backend.

The main entry points are config() (reads from DATABASE_URL environment variable with optional fallback) and parse() (accepts a URL string directly). Both return a Django DATABASES dictionary entry. The package also supports Django's connection pooling via conn_max_age and health checks via conn_health_checks, and allows registration of custom database backends with optional post-processing functions for non-standard configuration needs.

Use it for

  • Containerized deployments where database credentials are injected via environment variables at runtime.
  • Multi-environment setups (dev, staging, production) using the same code with different DATABASE_URL values.
  • Enabling connection pooling and health checks in Django without manual DATABASES dictionary construction.
  • Supporting non-standard or custom database backends by registering them with dj_database_url.register().
  • Migrating from hardcoded database settings to environment-driven configuration in existing Django projects.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a stable, actively maintained utility with zero known vulnerabilities, low install friction, and broad database backend support. It directly solves the common problem of externalizing database configuration in Django applications and is widely used in containerized and cloud-deployed environments. Install it if you use Django and want to follow 12factor principles for database configuration.

Install

dj-database-url on PyPI

Before you install

Low friction: single dependency on django, wheel-only distribution, actively maintained with recent commits. Supports current Python versions (3.10–3.14) and Django 4.2 through 6.

Requires DATABASE_URL environment variable to be set, or a default URL passed to config(); special characters in URLs must be percent-encoded.

License in practice

BSD-3-Clause (permissive): you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

import dj_database_url

DATABASES = {
    'default': dj_database_url.config(
        conn_max_age=600,
        conn_health_checks=True,
    )
}

Verify before relying

  • Whether custom backend registration persists across application reloads or requires per-request setup.
  • Performance impact of connection health checks on request latency in high-throughput scenarios.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
django
MaintenanceActively maintained 176 days since the last release
Last repo commit
First released
Downloads8,506,063 / month, #1,617 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Environment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.2Framework :: Django :: 6Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Evidence: dj_database_url-3.1.2-py3-none-any.whl

Tags

Capabilities
django database url environment variable12factor database configurationdjango database connection poolingparse database url djangodjango settings from urldatabase backend url parserdjango conn_max_age configuration
Topics
django-integrationenvironment-config12factor

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “django database url environment variable”

  • dj-database-urlParses DATABASE_URL environment variables into Django database…
  • django-environLoads and parses environment variables from .env files to configure…
  • django-cache-urlConfigures Django cache backends from environment variables using the…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also django-db-connection-pool · dsnparse · django-db-geventpool · dbt-copilot-python · django-heroku · django-snowflake · mssql-django · sqlalchemy-jdbcapi · databases · django-pg-returning