django-upgrade is a commandline tool that rewrites files in place. Pass your Django version as <major>.<minor> to the --target-version flag and the fixers will rewrite code to avoid DeprecationWarnings on that version of Django. For example:
django-upgrade --target-version 3.2 example/core/models.py example/settings.pyFeatures:
- Compatibility imports
-
url() to path() migration-
HttpRequest.headers- QuerySetPaginator
- Better tests
- And many others!
https://github.com/adamchainz/django-upgrade