{"id":13534100,"url":"https://github.com/browniebroke/django-codemod","last_synced_at":"2025-04-05T02:10:10.231Z","repository":{"id":37003629,"uuid":"261884067","full_name":"browniebroke/django-codemod","owner":"browniebroke","description":"A tool to automatically fix Django deprecations.","archived":false,"fork":false,"pushed_at":"2024-04-30T13:51:59.000Z","size":1626,"stargazers_count":173,"open_issues_count":10,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-01T13:51:51.204Z","etag":null,"topics":["codemod","django","hacktoberfest","libcst","python"],"latest_commit_sha":null,"homepage":"https://django-codemod.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browniebroke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["browniebroke"],"patreon":null,"open_collective":null,"ko_fi":"browniebroke","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-06T21:37:14.000Z","updated_at":"2024-05-03T16:00:28.517Z","dependencies_parsed_at":"2023-02-17T06:30:58.278Z","dependency_job_id":"f8b8e86c-0427-4268-aaae-9a136d6ee5ab","html_url":"https://github.com/browniebroke/django-codemod","commit_stats":{"total_commits":1177,"total_committers":25,"mean_commits":47.08,"dds":0.794392523364486,"last_synced_commit":"7cf7a74c4536187c25b8651d0df8f96cc37fe7f3"},"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browniebroke%2Fdjango-codemod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browniebroke%2Fdjango-codemod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browniebroke%2Fdjango-codemod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browniebroke%2Fdjango-codemod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browniebroke","download_url":"https://codeload.github.com/browniebroke/django-codemod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codemod","django","hacktoberfest","libcst","python"],"created_at":"2024-08-01T07:01:26.385Z","updated_at":"2025-04-05T02:10:10.215Z","avatar_url":"https://github.com/browniebroke.png","language":"Python","funding_links":["https://github.com/sponsors/browniebroke","https://ko-fi.com/browniebroke"],"categories":["Django Utilities","By Environment","Upgrading tools","Misc"],"sub_categories":["Python","ant-design"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Django Codemod\" src=\"https://raw.githubusercontent.com/browniebroke/django-codemod/main/assets/djangocodemod-stroke.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/browniebroke/django-codemod/actions/workflows/ci.yml?query=branch%3Amain\"\u003e\n    \u003cimg alt=\"CI Status\" src=\"https://img.shields.io/github/actions/workflow/status/browniebroke/django-codemod/ci.yml?branch=main\u0026label=CI\u0026logo=github\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://django-codemod.readthedocs.io\"\u003e\n    \u003cimg src=\"https://img.shields.io/readthedocs/django-codemod.svg?logo=read-the-docs\u0026logoColor=fff\u0026style=flat-square\" alt=\"Documentation Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/browniebroke/django-codemod\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/browniebroke/django-codemod.svg?logo=codecov\u0026logoColor=fff\u0026style=flat-square\" alt=\"Test coverage percentage\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://results.pre-commit.ci/latest/github/browniebroke/django-codemod/main\"\u003e\n    \u003cimg src=\"https://results.pre-commit.ci/badge/github/browniebroke/django-codemod/main.svg\" alt=\"pre-commit.ci status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/astral-sh/uv\"\u003e\n    \u003cimg src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json\" alt=\"uv\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/astral-sh/ruff\"\u003e\n    \u003cimg src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Ruff\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/pre-commit/pre-commit\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\u0026style=flat-square\" alt=\"pre-commit\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/django-codemod/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/django-codemod.svg?logo=python\u0026logoColor=fff\u0026style=flat-square\" alt=\"PyPi Status\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/pyversions/django-codemod.svg?style=flat-square\u0026logo=python\u0026amp;logoColor=fff\" alt=\"pyversions\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/l/django-codemod.svg?style=flat-square\" alt=\"license\"\u003e\n  \u003ca href=\"https://github.com/browniebroke/django-codemod\"\u003e\n    \u003cimg src=\"https://tokei.rs/b1/github/browniebroke/django-codemod/\" alt=\"LoC\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Documentation**: \u003ca href=\"https://django-codemod.readthedocs.io\" target=\"_blank\"\u003ehttps://django-codemod.readthedocs.io\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/browniebroke/django-codemod\" target=\"_blank\"\u003ehttps://github.com/browniebroke/django-codemod \u003c/a\u003e\n\n---\n\nA tool to help upgrade Django projects to newer version of the framework by automatically fixing deprecations.\n\n## The problem\n\nWhen 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.\n\nTake, 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.\n\n### This solution\n\nThis 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.\n\nWith 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.\n\nTo 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()`.\n\nInterested? Check out [the documentation](https://django-codemod.readthedocs.io) for usage and the full list of codemodders.\n\n### What this tool is not\n\n- This tool is best suited for Django sites, NOT for reusable Django applications. The project needs to target a single Django version, e.g. 3.1.x.\n- You do NOT need to install this tool as part of your project dependencies, it is a CLI tool, not a Django package to be installed in your site.\n\n### Similar tools\n\n[django-upgrade](https://github.com/adamchainz/django-upgrade) is a similar tool written by Adam Johnson. It's a reimplementation taking a different approach based only on standard library module.\n\ndjango-codemod is based on [libCST](https://libcst.readthedocs.io/) (Concrete Syntax Tree) which is a limiting factor in terms of speed. By using standard library modules, django-upgrade is a lot faster and is able to support the latest Python, however it requires Python 3.8+.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://browniebroke.com\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/861044?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBruno Alla\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=browniebroke\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=browniebroke\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-browniebroke\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://akx.github.io/\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/58669?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAarni Koskela\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=akx\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-akx\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=akx\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://adamj.eu/\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/857609?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdam Johnson\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=adamchainz\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://sobolevn.me\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/4660275?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNikita Sobolev\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=sobolevn\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.zapier.com\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/21158438?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eChris VanderKolk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=cvanderkolk\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://ghuser.io/jayvdb\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/15092?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJohn Vandenberg\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/issues?q=author%3Ajayvdb\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=jayvdb\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://iamshnoo.github.io/blog/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/45921510?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAnjishnu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-iamshnoo\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/drewbrew\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/7773256?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDrew Winstel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-drewbrew\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://DmytroLitvinov.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/16066485?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDmytro Litvinov\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=DmytroLitvinov\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://mzulqarnain1.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/23311265?v=4?s=80\" width=\"80px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eM. Zulqarnain\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/browniebroke/django-codemod/commits?author=mzulqarnain1\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\nThis package was created with\n[Cookiecutter](https://github.com/audreyr/cookiecutter) and the\n[audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage)\nproject template.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowniebroke%2Fdjango-codemod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowniebroke%2Fdjango-codemod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowniebroke%2Fdjango-codemod/lists"}