Django 5.2 Adds Composite Key Support
Written by Kay Ewbank   
Monday, 07 April 2025

Django 5.2 has been released with the addition of support for composite primary keys, and the automatic importing of all models in the shell by default.

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. 

django

One of the main changes in this release is the addition of support for composite primary keys. There's a new django.db.models.CompositePrimaryKey that allows tables to be created with a primary key consisting of multiple fields.

Another improvement means that all models from installed apps are automatically imported into the shell environment. Models from apps listed earlier in INSTALLED_APPS take precedence.

When Django 5 was released, it brought in simplified templates for form field rendering, with the addition of a field group and field group templates. This simplifies rendering of the related elements of a Django form field such as its label, widget, help text, and errors, and significantly reduces the amount of HTML and template code needed to render form elements, making your templates cleaner and more maintainable. The update to version 5.2 makes it easier to override a BoundField, as this can now be set on a form, field or project level.

Django 5.2 is designated as a long-term support release. It will receive security updates for at least three years after its release. Support for the previous LTS, Django 4.2, will end in April 2026. In terms of Python compatibility, Django 5.2 supports Python 3.10, 3.11, 3.12, and 3.13.

With the release of Django 5.2, Django 5.1 has reached the end of mainstream support. The final minor bug fix release, 5.1.8, which was also a security release, has now been issued. Django 5.1 will receive security and data loss fixes until December 2025. The new version also marks the end of extended support for Django 5.0. 

Django 5.2 is available now.  

 django

More Information

Django Project Website

Related Articles

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 Twitter, Facebook or Linkedin.

Banner


Cheap 3D Printed Robots Walk Off Production Line
20/07/2025

Robots that enthusiasts could build for under $500, and that are smart enough to walk off the 3D printer that formed them, have been demonstrated by a team at the University of Edinburgh. 



Apache Arrow 21 Released
07/07/2025

Version 21 of Apache Arrow has been released, including the first official Swift implementation of the platform. Improvements to Arrow 21 include exposing gRPC in the Flight client builder and improve [ ... ]


More News

pico book

 

Comments




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