Django-upgrade

Latest version: v1.24.0

Safety actively analyzes 722460 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

1.24.0

-------------------

* Parse target Django version from ``pyproject.toml``.
Now, if you don’t specify a version with ``--target-version``, django-upgrade will try to parse your minimum-supported target Django version from ``project.dependencies`` in ``pyproject.toml``.
It supports several common formats, like ``django>=5.2,<6.0``.

* Add Django 5.2+ fixer ``postgres_aggregate_order_by`` to rewrite PostgreSQL aggregate functions using the old argument name ``ordering`` to the new name ``order_by``.

* Add Django 5.2+ fixer ``staticfiles_find_all`` to rewrite calls to the staticfiles ``find()`` function using the old argument name ``all`` to the new name ``find_all``.

* Restore Django 5.0+ fixer ``model_field_choices``, with a restriction to only apply when the enumeration type is defined in the same file.

Thanks to Thibaut Decombe for initially contributing it in `PR 369 <https://github.com/adamchainz/django-upgrade/pull/369>`__.

* Add Django 2.0+ compatibility import rewrite of `django.http.cookie.SimpleCookie` to `http.cookies.SimpleCookie`.

Thanks to Thibaut Decombe in `PR 537 <https://github.com/adamchainz/django-upgrade/pull/537>`__.

1.23.1

-------------------

* Fix ``django_url`` fixer bug that failed for indented path strings.
This bug was introduced in 1.23.0.

Thanks to Michal Čihař for the report in `Issue 528 <https://github.com/adamchainz/django-upgrade/issues/528>`__.

1.23.0

-------------------

* Support Django 5.2 in ``--target-version``.

* Extend versioned block fixer to support comparisons with single-item tuples, like `django.VERSION >= (4,)`.

Thanks to Thibaut Decombe in `PR 517 <https://github.com/adamchainz/django-upgrade/pull/517>`__.

* Fix test decorator fixer to remove all indentation tokens from the decorator line.

Thanks to Thibaut Decombe in `PR 518 <https://github.com/adamchainz/django-upgrade/pull/518>`__.

* Fix ``django_url`` fixer handling of implicitly concatenated strings.

Thanks to Gunther Waidacher for the report in `Issue 524 <https://github.com/adamchainz/django-upgrade/issues/524>`__.

1.22.2

-------------------

* Make these fixers work when ``django.contrib.gis.db.models`` is used to import objects from ``django.db.models``:

* ``check_constraint_condition``
* ``index_together``

`Issue 513 <https://github.com/adamchainz/django-upgrade/issues/513>`__.

1.22.1

-------------------

* Fix circular import error when running django-upgrade.

Thanks to Michal Čihař for the report in `Issue 503 <https://github.com/adamchainz/django-upgrade/issues/503>`__.

1.22.0

-------------------

* Avoid accidental removal of comments a removed ``if`` block in the versioned block fixer.

Thanks to Tobias Funke for the report in `Issue 495 <https://github.com/adamchainz/django-upgrade/issues/495>`__.

* Add all-version fixer to remove outdated test skip decorators.

`Issue 364 <https://github.com/adamchainz/django-upgrade/issues/364>`__.

* Drop Python 3.8 support.

* Support Python 3.13.

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.