Skip to content

Remove Existing Django App

This guide explains how to remove an existing Django app from your project.

Steps

First, navigate to the project's root directory where the manage.py is located.

Reverse Migrations

Run the following command to delete the database tables associated with the app. This process automatically removes the specific tables and data from your database.

shell
# Replace <your app name>
uv run manage.py migrate <your app name> zero

Update Project Settings

Locate the INSTALLED_APPS list in your settings.py file and remove the entry for the app. This ensures Django no longer recognizes the app when you run your project.

Clean Up URLs

Check your project's main urls.py file. If you used the include() function to reference the app’s URLs, remove that line to avoid configuration errors.

Delete the App Files

After you have removed all references to the app in the settings and URLs, you can safely delete the app directory from your file system. This directory typically contains your models.py, views.py, and the migrations folder.

NOTE

You may also want to manually delete any media files or temporary cache data that the app stored in other locations.