/changelogs/django/django-5-2-to-6-1
Django 5.2 to 6.1: breaking changes and upgrade notes
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- Django
- versions
- 5.2 → 6.1
Django 6.0 was released on 2025-12-03 and 6.1 on 2026-08-05. Coming from 5.2 LTS, check the new minimum Python version (3.12), the DEFAULT_AUTO_FIELD default, and the APIs removed after their deprecation period. Django 6.1's mainstream support ends in April 2027 and extended support in December 2027.
Breaking changes in 6.0
- Python 3.12+ only. Django 6.0 supports Python 3.12, 3.13 and 3.14.
DEFAULT_AUTO_FIELDdefaults toBigAutoField. Projects created with older templates already set it. If yours never set it and its migrations useAutoField, setDEFAULT_AUTO_FIELD = "django.db.models.AutoField"(or the app'sdefault_auto_field) to avoid new migrations.forms.URLFieldtreats values without a scheme ashttps://; the transitionalFORMS_URLFIELD_ASSUME_HTTPSsetting is gone.- Removed after deprecation: positional arguments to
BaseConstraint, theDjangoDivFormRendererandJinja2DivFormRendererrenderers,cx_Oraclesupport (useoracledb),Prefetch.get_current_queryset(), overriding existing URL converters withregister_converter(), and more. - Databases: MariaDB 10.6+ is required; the PostgreSQL backend no longer uses
CASCADEwhen dropping a column. - Email: Django moved to Python's modern email API; undocumented
EmailMessageinternals changed.
New in 6.0
- Built-in Content Security Policy support.
- Template partials for reusable named fragments inside a template.
- A background tasks framework (
django.tasks).
6.1
- Supports Python 3.12, 3.13, 3.14 and, from 6.1.3, 3.15.
- Calendar versioning (DEP 20): the releases planned as Django 7.0 and 7.1 become Django 2028 and 2029, and
RemovedInDjango70Warningis renamedRemovedInDjango2028Warning. Updatefilterwarningsrules that mention the old class name. - New: model field fetch modes, database-level
on_deleteoptions forForeignKey, and mailers.
Upgrade path
- On 5.2, run tests with
python -Wd manage.py testand fix everyRemovedInDjango60Warning. - Move to Python 3.12+ and upgrade third-party packages to versions that support Django 6.
- Upgrade to 6.0, run
python manage.py makemigrations --checkto catch migrations caused by new defaults, then upgrade to 6.1.
Sources
Related pages
compat · djangoPython versions supported by each Django versionPython support per Django release: 5.2 LTS runs on Python 3.10 to 3.14; Django 6.0, 6.1 and 6.2 need 3.12 to 3.14, and 6.1.3+ adds 3.15. From the Django FAQ.commands · djangopython manage.py makemigrations and migrate: create and apply migrationsmakemigrations turns model changes into migration files and migrate applies them to the database. Preview SQL with sqlmigrate, check state with showmigrations.config · djangoDjango ALLOWED_HOSTS: values, wildcards and DisallowedHost errorsALLOWED_HOSTS lists the host names a Django site may serve. Any other Host header raises DisallowedHost, a 400 error. Use exact names or .example.com.