Latest in branch 4.2 (LTS)
4.2.30
Released 07 Apr 2026
(2 months ago)
SoftwareDjango
Version4.2 (LTS)
StatusLTS
End of life
Supported
Python versions
Python 3.8 - 3.12
Initial release4.2
03 Apr 2023
(3 years ago)
Latest release4.2.30
07 Apr 2026
(2 months ago)
End of
mainstream support
04 Dec 2023
(Ended 2 years ago)
End of
extended support
30 Apr 2026
(Ended 1 month ago)
Release noteshttps://docs.djangoproject.com/en/4.2/releases/
Source codehttps://github.com/django/django/tree/4.2.30
Documentationhttps://docs.djangoproject.com/en/4.2/
Django 4.2 (LTS) ReleasesView full list

What is New in Django 4.2

Django 4.2 is a feature release that adds support for Psycopg 3, new options for database comments, and a customizable file storage system. It improves the admin interface with themes and better widgets, enhances GIS and PostgreSQL capabilities, and includes security updates like BREACH mitigation. Several deprecations prepare for future changes, along with some backward incompatible updates.

Psycopg 3 Support

Django now works with the modern psycopg library version 3.1.8 or higher. The database engine setting stays the same, supporting both Psycopg 2 and 3. Note that Psycopg 3 has some differences from version 2.

Database Comments

Add descriptive comments to columns and tables directly in models.

class Question(models.Model):
    text = models.TextField(db_comment="Poll question")
    pub_date = models.DateTimeField(db_comment="Date and time when the question was published")

    class Meta:
        db_table_comment = "Poll questions"

Migrations support changing these comments.

Custom File Storages

The new STORAGES setting lets you define multiple backends for default files and static files. It replaces the old DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.

Admin Interface Updates

  • Light and dark theme toggle, including automatic system preference detection.
  • Uses system fonts for faster loading.
  • Filter widgets in changelists are now searchable.
  • Editable lists use atomic transactions for safety.
  • New blocks in templates for easier customization.

GIS Improvements

  • GeoJSON serialization includes an id key.
  • New isempty lookup for empty geometries on PostGIS.
  • Support for pathlib.Path in GDALRaster.
  • Updated OpenLayers widget to version 7.2.2.

Security Enhancements

  • GZipMiddleware adds random bytes to responses to protect against BREACH attacks.
  • Default PBKDF2 password hasher uses more iterations for stronger security.

Other Notable Features

  • In-memory storage for faster testing.
  • Async support in streaming responses.
  • New PostgreSQL lookups like trigram_strict_word_similar.
  • Improved error reporting with exception notes on Python 3.11+.
  • Central Kurdish language support.

Deprecations

  • index_together model option; use indexes instead.
  • Passing encoded JSON strings to JSONField.
  • Some password hashers and case-insensitive fields.
  • Old file storage settings.
  • Various APIs and template filters.

Backward Incompatible Changes

Area Change
Database Support Dropped MariaDB 10.3, MySQL 5.7, and PostgreSQL 11
Model Save update_or_create() passes update_fields to save()
MySQL Aggregations Raw SQL aggregations no longer allowed in GROUP BY
User Forms UserCreationForm handles many-to-many fields and stricter username checks

Why Upgrade to Django 4.2

Django 4.2 brings modern database support, better admin usability, and stronger security. It offers tools for cleaner code and faster development while maintaining stability. This release is a solid step forward for projects needing updated features and performance.

Releases In Branch 4.2 (LTS)

VersionRelease date
4.2.3007 Apr 2026
(2 months ago)
4.2.2903 Mar 2026
(3 months ago)
4.2.2803 Feb 2026
(4 months ago)
4.2.2702 Dec 2025
(6 months ago)
4.2.2605 Nov 2025
(7 months ago)
4.2.2501 Oct 2025
(8 months ago)
4.2.2403 Sep 2025
(9 months ago)
4.2.2310 Jun 2025
(1 year ago)
4.2.2204 Jun 2025
(1 year ago)
4.2.2107 May 2025
(1 year ago)
4.2.2006 Mar 2025
(1 year ago)
4.2.1905 Feb 2025
(1 year ago)
4.2.1814 Jan 2025
(1 year ago)
4.2.1704 Dec 2024
(1 year ago)
4.2.1603 Sep 2024
(1 year ago)
4.2.1506 Aug 2024
(1 year ago)
4.2.1409 Jul 2024
(1 year ago)
4.2.1307 May 2024
(2 years ago)
4.2.1206 May 2024
(2 years ago)
4.2.1104 Mar 2024
(2 years ago)
4.2.1006 Feb 2024
(2 years ago)
4.2.902 Jan 2024
(2 years ago)
4.2.804 Dec 2023
(2 years ago)
4.2.701 Nov 2023
(2 years ago)
4.2.604 Oct 2023
(2 years ago)
4.2.504 Sep 2023
(2 years ago)
4.2.401 Aug 2023
(2 years ago)
4.2.303 Jul 2023
(2 years ago)
4.2.205 Jun 2023
(3 years ago)
4.2.103 May 2023
(3 years ago)
4.203 Apr 2023
(3 years ago)
4.2rc120 Mar 2023
(3 years ago)
4.2b120 Feb 2023
(3 years ago)
4.2a117 Jan 2023
(3 years ago)