Django 4.2 Released

Now supports psycopg version 3.1.8 or higher, added security features and a lot more.
Listen to this story

The much-awaited Django 4.2, designated as a long-term support (LTS), has finally released. The latest version of this widely-used web framework is expected to receive security updates for a minimum of three years after its launch, until April 2026. As one of the most popular frameworks used by developers across the globe, the new release is another solid offering.

Django now supports psycopg version 3.1.8 or higher, which is the new implementation of widely-used PostgreSQL adapter for Python. The update introduces several new features, including support for table and column comments through the Field.db_comment and Meta.db_table_comment options. However, it is important to note that the function is available for all database backends included with Django, except for SQLite. Additionally, the migrations framework has been enhanced to propagate comments to the metadata of tables.

The contributors have also added a new security feature to mitigate the risk of breach attacks. Specifically, the framework will now add up to 100 random bytes to gzip responses, making it more difficult to carry out such attacks. Moreover, the new in-memory file storage is a useful feature that enables developers to avoid disk access, making it particularly valuable for speeding up tests.

Among the minor updates is the ability to toggle between light and dark colour themes for the admin interface, which can be set to follow the system setting. Additionally, the admin’s font stack has been updated to prefer system UI fonts, eliminating the need for downloading additional fonts. This change is aimed at improving performance and no longer requiring to download the fonts. Furthermore, CSS variables have been added, making it easier for developers to override default font families and customise the interface to their liking.

With the release, Django 4.1 has reached the end of mainstream support. Support for the previous LTS, (Django 3.2), will end in April 2024. Django 4.1 will receive security and data loss fixes until December 2023. All users are encouraged to upgrade before then to continue receiving fixes for security issues.

Django’s latest release marks the end of mainstream support for its predecessor, Django 4.1. Meanwhile, the previous long-term support (LTS) release, Django 3.2, is slated to reach its end of support in April 2024. For users still running Django 4.1, security and data loss fixes will continue to be available until December 2023. However, all users are advised to upgrade to the latest version of the framework as soon as possible.

There are a lot of other fixes and improvements that you can check out in the release notes.

Download our Mobile App

Subscribe to our newsletter

Join our editors every weekday evening as they steer you through the most significant news of the day.
Your newsletter subscriptions are subject to AIM Privacy Policy and Terms and Conditions.

Our Recent Stories

Our Upcoming Events

3 Ways to Join our Community

Telegram group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our Daily newsletter

Get our daily awesome stories & videos in your inbox