diff options
| author | Marcelo Galigniana <marcelogaligniana@gmail.com> | 2023-05-30 17:39:18 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-07-11 10:48:01 +0200 |
| commit | 2ddfa3e2b63d7a77270711dbe63aafb86abf4ddd (patch) | |
| tree | 7c31ef42b9424c345e83ce12e4fec8aa6ac5817b /docs | |
| parent | c7276a9cb97e8581faccb6c66a6a490e2d400c07 (diff) | |
Fixed #34309 -- Doc'd how to fully delete an app.
Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
Co-authored-by: shangxiao <shang.xiao.sanders@gmail.com>
Co-authored-by: sarahboyce <42296566+sarahboyce@users.noreply.github.com>
Co-authored-by: felixxm <felisiak.mariusz@gmail.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/delete-app.txt | 29 | ||||
| -rw-r--r-- | docs/howto/index.txt | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/docs/howto/delete-app.txt b/docs/howto/delete-app.txt new file mode 100644 index 0000000000..e1dac4f179 --- /dev/null +++ b/docs/howto/delete-app.txt @@ -0,0 +1,29 @@ +================================== +How to delete a Django application +================================== + +Django provides the ability to group sets of features into Python packages +called :doc:`applications</ref/applications/>`. When requirements change, apps +may become obsolete or unnecessary. The following steps will help you delete an +application safely. + +#. Remove all references to the app (imports, foreign keys etc.). + +#. Remove all models from the corresponding ``models.py`` file. + +#. Create relevant migrations by running :djadmin:`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. + +#. :ref:`Squash <migration-squashing>` 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 :setting:`INSTALLED_APPS`. + +#. Finally, remove the app's directory. diff --git a/docs/howto/index.txt b/docs/howto/index.txt index 05a0203132..0034032ce2 100644 --- a/docs/howto/index.txt +++ b/docs/howto/index.txt @@ -31,6 +31,7 @@ you quickly accomplish common tasks. static-files/deployment windows writing-migrations + delete-app .. seealso:: |
