{"title":"How to delete a Django application","version":"5.2","locale":"en","docname":"howto/delete-app","url":"/en/5.2/howto/delete-app/","canonical":"https://djangodocs.dev/en/5.2/howto/delete-app/","summary":"Django provides the ability to group sets of features into Python packages called applications . When requirements change, apps may become obsolete or unnecessary.…","html":"<h1>How to delete a Django application<a class=\"heading-anchor\" href=\"#how-to-delete-a-django-application\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Django provides the ability to group sets of features into Python packages\ncalled <a class=\"reference internal\" href=\"/en/5.2/ref/applications/\"><span class=\"doc\">applications</span></a>. When requirements change, apps\nmay become obsolete or unnecessary. The following steps will help you delete an\napplication safely.</p>\n<ol class=\"arabic simple\">\n<li><p>Remove all references to the app (imports, foreign keys etc.).</p></li>\n<li><p>Remove all models from the corresponding <code class=\"docutils literal notranslate\"><span class=\"pre\">models.py</span></code> file.</p></li>\n<li><p>Create relevant migrations by running <a class=\"reference internal\" href=\"/en/5.2/ref/django-admin/#django-admin-makemigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">makemigrations</span></code></a>. This step\ngenerates a migration that deletes tables for the removed models, and any\nother required migration for updating relationships connected to those\nmodels.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/5.2/topics/migrations/#migration-squashing\"><span class=\"std std-ref\">Squash</span></a> out references to the app in other apps’\nmigrations.</p></li>\n<li><p>Apply migrations locally, runs tests, and verify the correctness of your\nproject.</p></li>\n<li><p>Deploy/release your updated Django project.</p></li>\n<li><p>Remove the app from <a class=\"reference internal\" href=\"/en/5.2/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS</span></code></a>.</p></li>\n<li><p>Finally, remove the app’s directory.</p></li>\n</ol>","rootId":"how-to-delete-a-django-application","toc":[],"breadcrumbs":[{"docname":"howto/index","title":"How-to guides","url":"/en/5.2/howto/"}],"prev":{"docname":"howto/error-reporting","title":"How to manage error reporting","url":"/en/5.2/howto/error-reporting/"},"next":{"docname":"howto/upgrade-version","title":"How to upgrade Django to a newer version","url":"/en/5.2/howto/upgrade-version/"},"formats":{"html":"/en/5.2/howto/delete-app/","markdown":"/en/5.2/howto/delete-app.md","json":"/en/5.2/howto/delete-app.json"},"source":"https://github.com/django/django/blob/stable/5.2.x/docs/howto/delete-app.txt","official":"https://docs.djangoproject.com/en/5.2/howto/delete-app/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2"],"inLocales":["en","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}