Como excluir uma aplicação Django¶
O Django fornece a habilidade de agrupar conjuntos de funcionalidades em pacotes Python chamados applications. 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.
Remove all references to the app (imports, foreign keys etc.).
Remove all models from the corresponding
models.py
file.Create relevant migrations by running
makemigrations
. This step generates a migration that deletes tables for the removed models, and any other required migration for updating relationships connected to those models.Squash out references to the app in other apps’ migrations.
Apply migrations locally, runs tests, and verify the correctness of your project.
Deploy/release your updated Django project.
Remove the app from
INSTALLED_APPS
.Finally, remove the app’s directory.