Open-Source Wikis

/

Django

/

Reference

/

Dependencies

django/django

Dependencies

Django is a near-zero-dependency framework. The runtime tree is two packages plus a Windows-only shim. Optional features pull in extras; tests and docs have heavier requirements.

Runtime dependencies

From pyproject.toml:

dependencies = [
    "asgiref>=3.9.1",
    "sqlparse>=0.5.0",
    "tzdata; sys_platform == 'win32'",
]
Package Why License
asgiref The sync_to_async / async_to_sync bridge that powers ASGI and async views BSD-3-Clause
sqlparse Used by sqlmigrate and the pretty SQL output BSD-3-Clause
tzdata (Windows only) The IANA timezone database (Windows doesn't ship one) Apache-2.0

asgiref and sqlparse are both maintained by Django Software Foundation members. There are no transitive dependencies — asgiref and sqlparse are themselves dependency-free.

Optional dependencies

[project.optional-dependencies]
argon2 = ["argon2-cffi>=23.1.0"]
bcrypt = ["bcrypt>=4.1.1"]

Install with:

pip install Django[argon2]
pip install Django[bcrypt]

These pull in the password hashers in django.contrib.auth.hashers.Argon2PasswordHasher and BCryptSHA256PasswordHasher. The default PBKDF2PasswordHasher uses the standard library's hashlib.pbkdf2_hmac and needs no extras.

Database drivers

Drivers are not declared as dependencies; users install whatever matches their DATABASES["ENGINE"]:

Backend Driver Recommended version
sqlite3 sqlite3 (stdlib) n/a
postgresql psycopg (or psycopg2 for the legacy backend) psycopg>=3.2.0
mysql mysqlclient (preferred) or PyMySQL latest
oracle oracledb latest

GIS dependencies

django.contrib.gis requires system-level libraries:

  • GEOS ≥ 3.10 — required for all backends.
  • GDAL ≥ 3.4 — required for raster + vector data import/export.
  • PROJ ≥ 8.0 — required for coordinate transforms.

Plus a backend-specific spatial extension:

  • PostgreSQL: PostGIS ≥ 3.0
  • SQLite: SpatiaLite ≥ 5.0
  • MySQL: Spatial extensions (built-in 8.x)
  • Oracle: Oracle Spatial

Test dependencies

tests/requirements/py3.txt lists the test-time dependencies. The relevant ones at the time of this snapshot:

  • aiosmtpd — async SMTP server for email backend tests.
  • argon2-cffi — for the Argon2 password hasher tests.
  • bcrypt — for the bcrypt password hasher tests.
  • black, isort, flake8 — formatting and lint.
  • docutils — used by admindocs and ReST-based tests.
  • geoip2 — GeoIP2 tests.
  • Jinja2 — for template_backends/jinja2/ tests.
  • numpy — used by some gis tests.
  • Pillow — for ImageField tests.
  • PyYAML — for the YAML serialiser.
  • pywatchman — for the dev-server file watcher tests on macOS/Linux.
  • redis — for the django.core.cache.backends.redis backend tests.
  • selenium — for SeleniumTestCase tests (mostly admin).
  • tblib — multiprocessing traceback support for the parallel test runner.

Backend-specific tests pull from tests/requirements/<backend>.txt:

  • tests/requirements/postgres.txtpsycopg.
  • tests/requirements/mysql.txtmysqlclient.
  • tests/requirements/oracle.txtoracledb.

Docs dependencies

docs/requirements.txt pins:

  • Sphinx — the docs builder.
  • sphinxcontrib-spelling — spell-checking.
  • pyenchant — spell-check engine.

Plus the docs-specific tooling under docs/_ext/ and docs/_theme/.

Build / dev tooling

  • tox — orchestrates the test environments declared in tox.ini.
  • pre-commit — runs the hooks declared in .pre-commit-config.yaml.
  • black, isort, flake8, pyupgrade, blacken-docs, eslint, prettier — formatters and linters.
  • zizmor — workflow linter (config: zizmor.yml).
  • npm / Gruntfile.js — JavaScript test runner for js_tests/.
  • biome — newer JS/CSS lint/format (config: biome.json).

Python version support

pyproject.toml:

requires-python = ">= 3.12"
classifiers = [
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
]

Django 6.x requires Python 3.12+. Past version support follows a defined matrix; see docs/faq/install.txt for the supported-Python table.

License chain

Django itself is BSD-3-Clause (see LICENSE). The third-party Python code in django/dispatch/license.txt (license for the original PyDispatcher code) and LICENSE.python (license for Python code that was vendored from CPython) cover the small amounts of vendored code.

GIS backends link against GEOS (LGPL-2.1), GDAL (MIT-style), and PROJ (MIT-style); these are dynamically loaded system libraries, not bundled with Django.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Dependencies – Django wiki | Factory