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.

djangologo

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. 

 djangologo

More Information

Django Project Website

Related Articles

Django 5.2 Adds Composite Key Support

Welcoming Django 4

Django 4 Beta 1 Released

Django 3 Adds Support For ASGI

Django 1.3 released

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.

Banner


Kaggle Contest To Predict 3D Structure Of RNA
09/01/2026

A contest with a first prize of $50,000 launched on January 7, 2026. It is the second part of the Stanford RNA 3D Folding challenge and has already 102 teams actively participating.



Get Job-Ready With Scrimba
01/01/2026

The online learn-to-code platform, Scrimba, is running an end of year campaign until January 4th offering a 30% discount on its Scrimba Pro Annual plan for new subscribers.


More News

pico book

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 27 January 2026 )