{"title":"Como excluir uma aplicação Django","version":"5.0","locale":"pt-br","docname":"howto/delete-app","url":"/pt-br/5.0/howto/delete-app/","canonical":"https://djangodocs.dev/pt-br/5.0/howto/delete-app/","summary":"O Django fornece a habilidade de agrupar conjuntos de funcionalidades em pacotes Python chamados applications.","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/5.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\">models.py</code> file.</p></li>\n<li><p>Create relevant migrations by running <a class=\"reference internal\" href=\"/pt-br/5.0/ref/django-admin/#django-admin-makemigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemigrations</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/5.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, 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=\"/pt-br/5.0/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</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":"Guias de “como fazer”","url":"/pt-br/5.0/howto/"}],"prev":{"docname":"howto/writing-migrations","title":"How to create database migrations","url":"/pt-br/5.0/howto/writing-migrations/"},"next":{"docname":"faq/index","title":"Django - Perguntas e dúvidas frequentes.","url":"/pt-br/5.0/faq/"},"formats":{"html":"/pt-br/5.0/howto/delete-app/","markdown":"/pt-br/5.0/howto/delete-app.md","json":"/pt-br/5.0/howto/delete-app.json"},"source":"https://github.com/django/django/blob/stable/5.0.x/docs/howto/delete-app.txt","official":"https://docs.djangoproject.com/pt-br/5.0/howto/delete-app/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}