Stable Release in branch 5.1
5.1.15
Released 02 Dec 2025
(8 months ago)
SoftwareDjango
Version5.1
Status
End of life
Supported
Python versions
Python 3.10 - 3.12
Initial release5.1
07 Aug 2024
(2 years ago)
Latest release5.1.15
02 Dec 2025
(8 months ago)
End of
mainstream support
30 Apr 2025
(Ended 1 year ago)
End of
extended support
31 Dec 2025
(Ended 7 months ago)
Release noteshttps://docs.djangoproject.com/en/5.1/releases/
Source codehttps://github.com/django/django/tree/5.1.15
Documentationhttps://docs.djangoproject.com/en/5.1/
Django 5.1 ReleasesView full list

What is New in Django 5.1

Django 5.1 adds helpful tools like a querystring template tag, PostgreSQL connection pools, and a login required middleware. It improves accessibility in the admin, enhances GIS and form features, and strengthens security with more password hashing iterations. This release also removes support for older database versions and deprecates several outdated APIs.

Templates

A new template tag simplifies working with query parameters in URLs.

  • The {% querystring %} tag modifies current query strings while keeping existing parameters.
<a href="{% querystring page=next_page %}">Next</a>

Middleware

A new middleware handles authentication globally.

  • LoginRequiredMiddleware redirects unauthenticated users to the login page. Views can opt out with a decorator.

Database Enhancements

  • PostgreSQL supports connection pools to reduce latency.
  • New geospatial functions like BoundingCircle on SpatiaLite and Collect on MySQL.
  • GeoIP2 accepts IP address objects and exposes more location fields.
  • Area supports hectarage units.
  • Geometry objects gain 3D and measured value support.
  • BTreeIndex has a deduplicate items option.

Forms and Validation

  • Admin user forms support unusable passwords.
  • ReadOnlyPasswordHashWidget includes a password reset button.
  • New validator DomainNameValidator for internationalized domains.

Admin Improvements

  • Better accessibility with proper landmarks and semantic HTML.
  • Changelist filters in navigation elements.
  • Expandable fieldsets use native details and summary tags.

Security Updates

  • PBKDF2 password hasher uses more iterations for stronger protection.
  • Scrypt parallelism increased.

Other Additions

  • Sessions log cache operation exceptions.
  • Async methods in session backends.
  • File storage allows overwriting files.
  • Improved test assertions with better error messages.
  • Query parameters in test clients.
  • Management commands show operation categories in migrations.

Backward Incompatible Changes

Dropped support for older versions:

  • PostGIS 2.5, PROJ less than 6, GDAL 2.4.
  • MariaDB 10.4, PostgreSQL 12, SQLite less than 3.31.0.

Other changes include stricter GeoIP2 database handling, admin JavaScript removals, and updates to logging and field behaviors.

Deprecations

  • Some admin logging methods; use bulk versions instead.
  • Itercompat utility; use standard library alternatives.
  • GeoIP2 methods; prefer newer ones.
  • Positional arguments in model save methods.
  • Various index and geometry properties.
  • URL converter registration overrides.
  • Constraint check usage.
  • File storage flags.

Why Upgrade to Django 5.1

Django 5.1 enhances security, accessibility, and database performance while adding convenient tools for templates and middleware. It cleans up old dependencies and prepares for modern development, offering a smoother experience for building reliable web applications.

Releases In Branch 5.1

VersionRelease date
5.1.1502 Dec 2025
(8 months ago)
5.1.1405 Nov 2025
(9 months ago)
5.1.1301 Oct 2025
(10 months ago)
5.1.1203 Sep 2025
(11 months ago)
5.1.1110 Jun 2025
(1 year ago)
5.1.1004 Jun 2025
(1 year ago)
5.1.907 May 2025
(1 year ago)
5.1.802 Apr 2025
(1 year ago)
5.1.706 Mar 2025
(1 year ago)
5.1.605 Feb 2025
(1 year ago)
5.1.514 Jan 2025
(1 year ago)
5.1.404 Dec 2024
(1 year ago)
5.1.305 Nov 2024
(1 year ago)
5.1.208 Oct 2024
(1 year ago)
5.1.103 Sep 2024
(1 year ago)
5.107 Aug 2024
(2 years ago)
5.1rc124 Jul 2024
(2 years ago)
5.1b126 Jun 2024
(2 years ago)
5.1a122 May 2024
(2 years ago)