Removing a django app is easy, remove all imports and usage of the app and also from INSTALLED_APPS section in settings.py.

That does remove the app from the project, but not the files and the apps history from the project. The app files will still be in the project and the database will exist in the DB, unless you clone the code to a new machine and migrate, because the migrations of the removed app won’t be consider since is removed from settings.py.

So removing a Django app involves these steps:

  • Remove all imports and usage of the app in the project.
  • Remove all models in models.py of the app. Can bring in error if the models are called in other files of the app like admin.py or any other so remove the reference or just delete the files expect __init__.py and models.py.
  • Create a new migration for the app, which removes all models.
  • Perform Migration.
  • Production : If this is to be done in production, perform tests, push the code to production and perform migration before you proceed to next step.
  • Remove the app from INSTALLED_APPS in settings.py.
  • Delete the directory.

This removes the app database and also files, but make sure to remove any packages you used by the app which is not required in project and update the other documentation.

If you have deleted the files before performing the remove migrations, you can drop tables from project database manually depending on your database.