Skip to main content

Collections of libCST codemodders to upgrade Django

Project description

Django Codemod

image image Documentation Status Updates

All Contributors

Collections of libCST codemodder to help upgrades to newer versions of Django.


This is based on libCST and implements codemods for it. This is currently very limited but the aim is to add more for helping with upcoming deprecations.

Currently implemented codemodders are listed below and grouped by the version of Django where deprecations are removed.

Not finding what you need? I'm open to contributions, please send me a pull request.

Django 4.0

All these are in the module django_codemod.commands.django_40:

  • ForceTextToForceStrCommand: migrate deprecated force_text() function to force_str().
  • SmartTextToForceStrCommand: migrate deprecated smart_text() function to smart_str().
  • UGetTextToGetTextCommand: migrate deprecated ugettext() function to gettext().
  • UGetTextLazyToGetTextLazyCommand: migrate deprecated ugettext_lazy() function to gettext_lazy().
  • UGetTextNoopToGetTextNoopCommand: migrate deprecated ugettext_noop() function to gettext_noop().
  • UNGetTextToNGetTextCommand: migrate deprecated ungettext() function to ngettext().
  • UNGetTextLazyToNGetTextLazyCommand: migrate deprecated ungettext_lazy() function to ngettext_lazy().
  • URLToRePathCommand: migrate deprecated url() function to re_path().

Django 3.2

All these are in the module django_codemod.commands.django_32:

Nothing these yet!

Django 3.1

All these are in the module django_codemod.commands.django_31:

Nothing these yet!

Django 3.0

All these are in the module django_codemod.commands.django_30:

  • RenderToResponseToRenderCommand: migrate deprecated render_to_response() function to render().

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Bruno Alla

💻 🐛 📖

Adam Johnson


This project follows the all-contributors specification. Contributions of any kind welcome!


This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-codemod, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size django_codemod-0.4.0-py2.py3-none-any.whl (7.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-codemod-0.4.0.tar.gz (13.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page