Welcome to Django Codemod’s documentation!¶
A tool to help upgrade Django projects to newer version of the framework by automatically fixing deprecations.
The problem
When maintaining a Django site, over time you’ll find yourself to a point where you’ll need to update to the next major version of Django. When Django APIs changes, functions move or are removed, changing usages in your project might add up to many changes. Often these changes are simple to do, but sometimes a simple “find and replace” is not possible.
Take, for instance, the removal of the url()
function from Django 4.0, to be replaced by re_path()
. In simple cases, you might even want to switch to path()
, which has a nicer API. A typical Django project easily has 100’s or routes, so this simple decision becomes a much longer task when to be made for each of them.
This solution
This project solves this problem by providing codemodders for simple changes like this. A codemodder re-writes your code from the old way to the new way.
With the help of AST analysis, we’re able to understand what modifications are applicable, remove imports as they become irrelevant, and add missing ones as they are needed.
To continue the example, the tool will look at the route in the url()
call, and decide whether the regular expression may be replaced by one of the built-in URL converters and use path()
or stick to a regex and use re_path()
.
Interested? Check out the next sections for installation and usage.
- Contributing
- CHANGELOG
- v2.2.2 (2024-11-19)
- v2.2.1 (2024-10-31)
- v2.2.0 (2024-10-31)
- v2.1.11 (2024-05-07)
- v2.1.10 (2024-04-30)
- v2.1.9 (2024-01-05)
- v2.1.8 (2023-12-11)
- v2.1.7 (2023-12-03)
- v2.1.6 (2023-11-15)
- v2.1.5 (2023-11-01)
- v2.1.4 (2023-10-12)
- v2.1.3 (2023-10-06)
- v2.1.2 (2023-09-30)
- v2.1.1 (2023-09-17)
- v2.1.0 (2023-08-07)
- v2.0.0 (2023-06-27)
- v1.11.7 (2023-03-27)
- v1.11.6 (2023-03-16)
- v1.11.5 (2023-03-16)
- v1.11.4 (2023-01-10)
- v1.11.3 (2022-11-11)
- v1.11.2 (2022-11-10)
- v1.11.1 (2022-11-07)
- v1.11.0 (2022-08-31)
- v1.10.9 (2022-07-12)
- v1.10.8 (2022-07-04)
- v1.10.7 (2022-06-17)
- v1.10.6 (2022-06-13)
- v1.10.5 (2022-06-10)
- v1.10.4 (2022-06-06)
- v1.10.3 (2022-05-11)
- v1.10.2 (2022-05-04)
- v1.10.1 (2022-04-14)
- v1.10.0 (2022-04-11)
- v1.9.1 (2022-03-11)
- v1.9.0 (2022-02-27)
- v1.8.2 (2022-02-11)
- v1.8.1 (2022-01-28)
- v1.8.0 (2022-01-24)
- v1.7.1 (2022-01-13)
- v1.7.0 (2022-01-10)
- v1.6.6 (2021-12-11)
- v1.6.5 (2021-11-23)
- v1.6.4 (2021-11-22)
- v1.6.3 (2021-09-21)
- v1.6.2 (2021-09-16)
- v1.6.1 (2021-09-13)
- v1.6.0 (2021-09-11)
- v1.5.8 (2021-08-13)
- v1.5.7 (2021-07-21)
- v1.5.6 (2021-06-17)
- v1.5.5 (2021-06-13)
- v1.5.4 (2021-05-16)
- v1.5.3 (2021-05-13)
- v1.5.2 (2021-05-04)
- v1.5.1 (2021-04-22)
- v1.5.0 (2021-04-22)
- v1.4.1 (2021-04-02)
- v1.4.0 (2021-03-02)
- v1.3.7 (2021-02-09)
- v1.3.6 (2021-02-02)
- v1.3.5 (2021-01-27)
- v1.3.4 (2021-01-21)
- v1.3.3 (2021-01-21)
- v1.3.2 (2021-01-19)
- v1.3.1 (2021-01-19)
- v1.3.0 (2021-01-14)
- v1.2.0 (2021-01-05)
- v1.1.0 (2021-01-02)
- v1.0.0 (2020-11-11)
- v0.21.0 (2020-10-19)
- v0.20.0 (2020-10-13)
- v0.19.0 (2020-10-10)
- v0.18.0 (2020-09-21)
- v0.17.5 (2020-09-17)
- v0.17.4 (2020-09-17)
- v0.17.3 (2020-09-17)
- v0.17.2 (2020-09-17)
- v0.17.1 (2020-09-17)
- v0.17.0 (2020-09-16)
- v0.16.0 (2020-09-15)
- v0.15.0 (2020-09-15)
- v0.14.0 (2020-09-15)
- v0.13.3 (2020-09-15)
- v0.13.2 (2020-09-15)
- v0.13.1 (2020-09-14)
- v0.13.0 (2020-07-26)
- v0.12.0 (2020-07-21)
- v0.11.0 (2020-07-20)
- v0.10.1 (2020-07-17)
- v0.10.0 (2020-07-04)
- v0.9.0 (2020-06-18)
- v0 (2020-06-18)
- v0.8.1 (2020-06-07)
- v0.8.0 (2020-06-02)
- v0.7.0 (2020-05-23)
- v0.6.0 (2020-05-22)
- v0.5.0 (2020-05-13)
- v0.4.0 (2020-05-11)
- v0.3.0 (2020-05-10)
- v0.2.1 (2020-05-10)
- v0.2.0 (2020-05-10)
- v0.1.1 (2020-05-07)
- v0.1.0 (2020-05-06)