skillfed

django-upgrade

Automatically upgrade your Django project code.

django-upgrade v1.31.1 561.8K downloads/30d#5,993 on PyPI1,228
Permissive license MIT Active released

What it is and what it does

django-upgrade is a command-line tool that automatically refactors Django project code to use modern syntax and APIs. It scans your codebase and applies transformations that align with newer Django versions, removing deprecated patterns and updating function calls to their current equivalents. This saves manual effort when upgrading large projects across multiple Django versions.

The tool depends on tokenize-rt for safe token-level code manipulation. It targets Django versions from 2.2 through 6.0 and runs on Python 3.10 or later. With active maintenance and broad version support, it's designed to handle the friction of keeping Django codebases current as the framework evolves.

Use it for:

  • Bulk-upgrade a Django 3.2 project to Django 5.0 syntax and APIs in a single pass.
  • Remove deprecated Django ORM calls and template tags across a large codebase automatically.
  • Prepare a legacy Django project for a major version jump by applying intermediate upgrade rules.
  • Enforce modern Django patterns in a team codebase during a scheduled maintenance window.
  • Reduce manual code review effort by automating repetitive deprecation fixes.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically modernizes Django project code by applying syntax and API upgrades across your codebase to match newer Django versions.

Yes. django-upgrade is actively maintained, has no security vulnerabilities, installs with minimal friction, and solves a real problem for Django teams managing version upgrades. The MIT license is permissive. Install it if you maintain a Django project and want to reduce the manual work of keeping code aligned with current Django versions.

Install

django-upgrade on PyPI

pip

pip install django-upgrade

uv

uv add django-upgrade

poetry

poetry add django-upgrade

Installing django-upgrade

Before you install

Low friction install with a single runtime dependency. Active maintenance with recent releases and a solid community signal (1228 stars); last commit on 2026-08-13 indicates ongoing development.

License in practice

MIT license permits use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install django-upgrade
django-upgrade --target-version 5.0 path/to/django/code

Requires Python 3.10 or later.

Verify before relying

  • Specific upgrade rules and which Django versions are supported as targets beyond the framework classifiers listed.
  • Whether the tool modifies files in-place or requires review before applying changes.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — tokenize-rt
Maintenance actively maintained — 50 days since the last release
Last repo commit
First released
Downloads 561,754/month — #5,993 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_upgrade-1.31.1-py3-none-any.whl

Keywords: Django

Development Status :: 5 - Production/StableFramework :: Django :: 2.2Framework :: Django :: 3.0Framework :: Django :: 3.1Framework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

django code modernizationautomatic django upgradedjango syntax fixerupgrade django codebasedjango deprecation removaldjango api migration tool
djangocode-modernizationrefactoring-tool

More Build Tools packages