| Django 6 Adds Content Security Policy Support |
| Written by Alex Denham | |||
| Tuesday, 27 January 2026 | |||
|
Django 6.0 has been released with new features including native Content Security Policy support, a built-in background tasks framework, and improvements to templates for component-based development. Django is a high-level Python web framework for creating full stack dynamic websites. It is free and open-source, and the developers say it encourages rapid development and clean, pragmatic design, and that it takes care of much of the hassle of web development, so you can focus on writing your app.
The first improvement of note is the addition of built-in support for the Content Security Policy (CSP) standard . This is designed to help protect web applications against content injection attacks such as cross-site scripting (XSS). CSP allows declaring trusted sources of content by giving browsers strict rules about which scripts, styles, images, or other resources can be loaded. CSP policies can now be enforced or monitored directly using built-in tools. The second improvement is that the Django Template Language now supports template partials, making it easier to encapsulate and reuse small named fragments within a template file. Django now includes a built-in Tasks framework for running code outside the HTTP request–response cycle without the need for third-party libraries such as Celery. The new framework enables offloading work, such as sending emails or processing data, to background workers. The framework provides task definition, validation, queuing, and result handling. Once defined, tasks can be added to queues through a configured backend. Django takes care of the task creation and queuing, though the external elements have to manage the task execution. This release also adopts Python's modern email API. This was introduced in Python 3.6, and offers a cleaner and Unicode-friendly interface for composing and sending emails. It replaces use of Python's older legacy (Compat32) API, which relied on lower-level MIME classes (from email.mime) and required more manual handling of message structure and encoding. Django 6 is available now. More InformationRelated ArticlesDjango 5.2 Adds Composite Key Support Django 3 Adds Support For ASGI To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
|||
| Last Updated ( Tuesday, 27 January 2026 ) |


