Django 6.0 brings template partials, background tasks, Content Security Policy, and more
Django 6.0 introduces several notable features aimed at improving code modularity, security, and developer workflow. Template partials are now available, allowing projects to modularize templates using small, named fragments. This update makes it easier to maintain and reuse code across large web applications.
In addition, the new built-in background task framework enables developers to run code outside the standard HTTP request-response cycle. This is useful for handling tasks such as sending emails or performing database operations asynchronously within Django projects.
Security has been enhanced with the ability to easily configure and enforce Content Security Policy headers. By supporting CSP, Django 6.0 helps projects defend against content injection vulnerabilities that can affect web applications.
Following these core improvements, Django's email API has been modernized. Developers can now compose and send emails using Python's EmailMessage class, providing a clearer and more Unicode-friendly interface than earlier versions.
With the release of Django 6.0, Django 5.2 has reached the end of mainstream support. The final bug fix release, 5.2.9, has been issued, and only security and data loss fixes will continue until April 2028. Additionally, Django 5.1 is no longer receiving extended support as of its last security release, 5.1.15, issued on December 2, 2025.
