Django

raw JSON →
6.0.3 verified Tue May 12 auth: no python install: verified quickstart: stale

High-level Python web framework. Two active release lines: 6.0.3 (latest, Dec 2025, requires Python >=3.12) and 5.2.x LTS (Apr 2025, Python >=3.10, EOL Apr 2028). Feature releases roughly every 8 months. Deprecations follow a two-release cycle before removal.

pip install Django
error ModuleNotFoundError: No module named 'corsheaders'
cause The 'django-cors-headers' package is not installed in the current Python environment.
fix
Install the package using 'pip install django-cors-headers'.
error ModuleNotFoundError: No module named 'allauth'
cause The 'django-allauth' package is not installed in the current Python environment.
fix
Install the package using 'pip install django-allauth'.
error ModuleNotFoundError: No module named 'rest_framework'
cause The 'djangorestframework' package is not installed in the current Python environment.
fix
Install the package using 'pip install djangorestframework'.
error ModuleNotFoundError: No module named 'crispy_forms'
cause The 'django-crispy-forms' package is not installed in the current Python environment.
fix
Install the package using 'pip install django-crispy-forms'.
error ModuleNotFoundError: No module named 'channels'
cause The 'channels' package is not installed in the current Python environment.
fix
Install the package using 'pip install channels'.
breaking Django 6.0 requires Python >=3.12. Python 3.10 and 3.11 support dropped. Projects on Python 3.10/3.11 must stay on Django 5.2 LTS (EOL Apr 2028).
fix Use Django 5.2 LTS for Python 3.10/3.11 projects. Upgrade Python to 3.12+ to use Django 6.0.
breaking cx_Oracle driver removed in Django 6.0. Oracle users must migrate to the oracledb driver (>=1.3.2). cx_Oracle was deprecated in Django 5.0.
fix pip install oracledb and update DATABASE ENGINE to django.db.backends.oracle. The oracledb driver uses the same connection parameters.
breaking QuerySet.return_insert_columns renamed to returning_columns in Django 6.0.
fix Replace return_insert_columns= with returning_columns= in bulk_create() calls.
breaking Django 6.0 overhauled email internals to use Python's modern email API. SafeMIMEText, SafeMIMEMultipart, and BadHeaderError are deprecated. Custom email subclasses relying on internal underscore methods may break silently.
fix Audit any custom EmailMessage subclasses. Replace SafeMIMEText/SafeMIMEMultipart references. BadHeaderError replaced by ValueError.
breaking MariaDB minimum version raised to 10.6 in Django 6.0. MariaDB 10.5 support dropped.
fix Upgrade MariaDB to 10.6+ before upgrading Django to 6.0.
gotcha DEFAULT_AUTO_FIELD must be set in settings.py. Omitting it causes W042 system check warnings for every model in the project. LLMs frequently omit this from generated settings files.
fix Add DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' to settings.py.
gotcha Two active release lines with different Python requirements. Django 6.0 (Python >=3.12) and Django 5.2 LTS (Python >=3.10). LLM-generated code often installs the latest without checking Python version compatibility.
fix Pin Django version explicitly: Django>=5.2,<6 for Python 3.10/3.11. Django>=6.0 for Python 3.12+.
gotcha ADMINS and MANAGERS setting format changed in Django 6.0: list of (name, email) tuples is deprecated. Must be a list of email strings. Format as '"Name" <email>' for named addresses.
fix ADMINS = ['admin@example.com'] or ADMINS = ['"Admin Name" <admin@example.com>']
gotcha BASE_DIR is a common variable in Django settings.py, usually defined as `BASE_DIR = Path(__file__).resolve().parent.parent`. Omitting its definition will cause a NameError.
fix Ensure BASE_DIR is defined in settings.py, e.g., `from pathlib import Path; BASE_DIR = Path(__file__).resolve().parent.parent`.
pip install "Django>=5.2,<6"
pip install "Django[argon2]"
python os / libc variant status wheel install import disk
3.10 alpine (musl) "Django>=5.2,<6" - - 0.02s 66.2M
3.10 alpine (musl) argon2 - - 0.02s 68.0M
3.10 alpine (musl) Django - - 0.02s 66.2M
3.10 slim (glibc) "Django>=5.2,<6" - - 0.01s 67M
3.10 slim (glibc) argon2 - - 0.01s 69M
3.10 slim (glibc) Django - - 0.01s 67M
3.11 alpine (musl) "Django>=5.2,<6" - - 0.03s 70.6M
3.11 alpine (musl) argon2 - - 0.03s 72.7M
3.11 alpine (musl) Django - - 0.03s 70.6M
3.11 slim (glibc) "Django>=5.2,<6" - - 0.02s 71M
3.11 slim (glibc) argon2 - - 0.03s 73M
3.11 slim (glibc) Django - - 0.02s 71M
3.12 alpine (musl) "Django>=5.2,<6" - - 0.02s 61.8M
3.12 alpine (musl) argon2 - - 0.02s 64.2M
3.12 alpine (musl) Django - - 0.02s 62.1M
3.12 slim (glibc) "Django>=5.2,<6" - - 0.02s 62M
3.12 slim (glibc) argon2 - - 0.02s 65M
3.12 slim (glibc) Django - - 0.02s 63M
3.13 alpine (musl) "Django>=5.2,<6" - - 0.03s 61.5M
3.13 alpine (musl) argon2 - - 0.02s 63.9M
3.13 alpine (musl) Django - - 0.02s 61.9M
3.13 slim (glibc) "Django>=5.2,<6" - - 0.02s 62M
3.13 slim (glibc) argon2 - - 0.02s 64M
3.13 slim (glibc) Django - - 0.02s 62M
3.9 alpine (musl) "Django>=5.2,<6" - - - -
3.9 alpine (musl) argon2 - - 0.02s 66.8M
3.9 alpine (musl) Django - - 0.02s 64.2M
3.9 slim (glibc) "Django>=5.2,<6" - - - -
3.9 slim (glibc) argon2 - - 0.01s 67M
3.9 slim (glibc) Django - - 0.01s 65M

Minimal Django settings and model. Always set DEFAULT_AUTO_FIELD.

# settings.py (minimal)
INSTALLED_APPS = [
    'django.contrib.contenttypes',
    'django.contrib.auth',
]
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

# models.py
from django.db import models

class Article(models.Model):
    title = models.CharField(max_length=200)
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta:
        ordering = ['-created_at']

# shell
# python manage.py makemigrations
# python manage.py migrate
# python manage.py runserver