Django 6.0 introduces template partials for reusable template fragments (especially useful with htmx), a built-in tasks framework for background job processing, native Content Security Policy support with automatic nonce generation, and modernized email handling using Python's newer email API. Additional improvements include universal StringAgg aggregate across all databases, BigAutoField as the default primary key type to prevent exhaustion issues, dynamic field refresh after save operations using RETURNING clauses, and various template and ORM enhancements.
Table of contents
Upgrade with help from django-upgradeTemplate partialsTasks frameworkContent Security Policy supportEmail API updatesPositional arguments in django.core.mail APIsExtended automatic shell importsDynamic field refresh on save()Universal StringAgg aggregateBigAutoField as the default primary key typeTemplate variable forloop.lengthquerystring template tag enhancementsFinSort: