About Removing Third-party Django Apps

Here's how you can remove a third-party Django app (let's call it django-external-app):

  1. Create a database backup.
  2. Remove all the relational fields in your apps referencing the models of django-external-app, create migrations, migrate.
  3. Remove all the lines in your migrations of your apps that added, altered, or removed relations to django-external-app models. But keep the migration files.
  4. Unmigrate all migrations for django-external-app like so:

    (venv)$ python manage.py migrate external_app zero

  5. Remove any code in your project related to django-external-app.

  6. Uninstall django-external-app.

Tips and Tricks Development Django 5.x Django 4.2 Django 3.2 pip pip-tools