Django 6.0.x
Supported until 2027-04-01
Django 6.0 introduces powerful new features for building modern web applications, including built-in Content Security Policy support, template partials for cleaner code organization, a background tasks framework, and a modernized email API. This release also drops support for Python 3.10 and 3.11, requiring Python 3.12 or higher.
Release Highlights:
- Built-in Content Security Policy (CSP) framework with middleware and configuration settings to protect against injection attacks.
- Template partials via
{% partialdef %}and{% partial %}tags enable reusable template fragments without creating separate files. - Background tasks framework for defining and queuing tasks outside the request-response cycle using decorators.
- Modernized email API using Python’s native email implementation for cleaner Unicode handling.
AsyncPaginatorandAsyncPageclasses for async-compatible pagination.- New
forloop.lengthvariable available in template loops. StringAggaggregate function now available on all database backends.- Font Awesome 6.7.2 icons in the admin interface.
Upgrade Gotchas:
- Python version requirement: Django 6.0 requires Python 3.12, 3.13, or 3.14. Python 3.10 and 3.11 are no longer supported.
- MariaDB version requirement: MariaDB 10.5 support has been dropped; MariaDB 10.6+ is now required.
- DEFAULT_AUTO_FIELD change: The default value changed from
AutoFieldtoBigAutoField. Existing projects should explicitly set this in settings if they want to keep usingAutoField. - ORM expression parameters: Custom ORM expressions must now return parameters as tuples instead of lists.
- Email API changes: The
mixed_subtype,alternative_subtype, andencodingproperties have been removed from email classes. Positional arguments indjango.core.mailAPIs are deprecated and require keyword arguments. - JSON serializer output: The JSON serializer now adds a newline to output, which may affect tests or integrations that compare exact output.
- Database backend changes: Custom database backends need to update
returning_columns()andfetch_returned_rows()implementations.
Major Features:
- Content Security Policy (CSP) support with built-in middleware and context processors
- Template partials with
{% partialdef %}and{% partial %}template tags - Background tasks framework with decorator-based task definition and configurable backends
- Modern email API based on Python’s native
emailmodule implementation - Async pagination support with
AsyncPaginatorandAsyncPage AnyValueaggregate for SQLite, MySQL, Oracle, and PostgreSQL 16+
- Python 3.12
- Python 3.13
Released Versions
| Version | Release Date | Release Type | Blog Post | Release Notes | GitHub |
|---|---|---|---|---|---|
| 6.0.2 | 2026-02-03 |
SECURITY
|
Blog Post | Release Notes | GitHub |
| 6.0.1 | 2026-01-06 |
BUGFIX
|
Blog Post | Release Notes | GitHub |
| 6.0 | 2025-12-03 |
RELEASE
|
Blog Post | Release Notes | GitHub |
| 6.0rc1 | 2025-11-19 | Blog Post | Release Notes | GitHub | |
| 6.0b1 | 2025-10-22 |
BETA
|
Blog Post | Release Notes | GitHub |
| 6.0a1 | 2025-09-17 |
ALPHA
|
Blog Post | Release Notes | GitHub |