# Upgrade Django v5.2.x

Django 5.2 brings a host of enhancements designed to improve developer productivity, bolster performance, and enhance customization. Notably, it introduces
several major new features that streamline workflows, modernize the framework’s architecture, and improve its support for asynchronous operations.

## Release Highlights:

- Automatic models import in the shell: Models from all installed apps are auto-imported when running the shell, reducing setup time.
- Composite Primary Keys support: The new `CompositePrimaryKey` field enables models to use multiple fields as primary keys.
- Simplified `BoundField` customization: Developers can now more easily override form rendering by setting a custom `BoundField` at project, form, or field level.
- Expanded asynchronous support in authentication: A suite of new async methods and improved async backend implementations enhance performance and ease of use.
- New form widgets and accessibility improvements: Introduction of widgets like `ColorInput`, `SearchInput`, `TelInput`; along with new accessibility attributes for forms.
- Improved QuerySet value ordering: `values()` and `values_list()` now generate a `SELECT` clause in the specified order.
- Enhanced response and request handling: New properties and methods on `HttpResponse` and `HttpRequest` add flexibility and clarity when handling HTTP data.

## Upgrade Gotchas:

- Dropped support for PostgreSQL 13 and older versions of GDAL and PostGIS may require backend updates.
- Default MySQL connection character set changed to utf8mb4, which may affect legacy databases.
- Some minor backward-incompatible changes in areas such as error reporting and permission handling require attention.

## Major Features:

- Automatic models import in the shell
- Composite Primary Keys with `models.CompositePrimaryKey`
- Simplified customization of `BoundField` for forms
- Expanded asynchronous methods in `django.contrib.auth` and auth backends
- New form widgets (`ColorInput`, `SearchInput`, `TelInput`) and enhanced accessibility
- Improved QuerySet and database function capabilities (e.g., `JSONArray`, `set_returning`)

Source: https://upgradedjango.com/5.2/
