{"title":"Como excluir uma aplicação Django","version":"6.0","locale":"pt-br","docname":"howto/delete-app","url":"/pt-br/6.0/howto/delete-app/","canonical":"https://djangodocs.dev/pt-br/6.0/howto/delete-app/","summary":"O Django fornece a habilidade de agrupar conjuntos de funcionalidades em pacotes Python chamados applications . Quando os requisitos mudam seus apps podem se tornar…","html":"<h1>Como excluir uma aplicação Django<a class=\"heading-anchor\" href=\"#how-to-delete-a-django-application\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>O Django fornece a habilidade de agrupar conjuntos de funcionalidades em pacotes Python chamados  <a class=\"reference internal\" href=\"/pt-br/6.0/ref/applications/\"><span class=\"doc\">applications</span></a>. Quando os requisitos mudam seus apps podem se tornar obsoletos ou desnecessários. Os seguintes passos vão ajudar você a excluir uma aplicação de maneira segura.</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=\"/pt-br/6.0/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=\"/pt-br/6.0/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, run 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=\"/pt-br/6.0/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":"/pt-br/6.0/howto/"}],"prev":{"docname":"howto/error-reporting","title":"How to manage error reporting","url":"/pt-br/6.0/howto/error-reporting/"},"next":{"docname":"howto/upgrade-version","title":"How to upgrade Django to a newer version","url":"/pt-br/6.0/howto/upgrade-version/"},"formats":{"html":"/pt-br/6.0/howto/delete-app/","markdown":"/pt-br/6.0/howto/delete-app.md","json":"/pt-br/6.0/howto/delete-app.json"},"source":"https://github.com/django/django/blob/stable/6.0.x/docs/howto/delete-app.txt","official":"https://docs.djangoproject.com/pt-br/6.0/howto/delete-app/","inVersions":["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"]}