summaryrefslogtreecommitdiff
path: root/docs/howto
diff options
context:
space:
mode:
authorjkrzy <j@jkrzy.com>2017-08-18 13:52:06 -0700
committerTim Graham <timograham@gmail.com>2017-09-02 16:21:13 -0400
commit48d92fea672928b4571ddaab03667e74671391c0 (patch)
tree4142b53fb4b43f9246278c1b15da3f3a61e49b24 /docs/howto
parent54f7aa04a76627258007c1f37992bdf62af3ac35 (diff)
Fixed #28367 -- Doc'd how to override management commands.
Diffstat (limited to 'docs/howto')
-rw-r--r--docs/howto/custom-management-commands.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
index 453896b29a..77405a1622 100644
--- a/docs/howto/custom-management-commands.txt
+++ b/docs/howto/custom-management-commands.txt
@@ -181,6 +181,24 @@ Testing
Information on how to test custom management commands can be found in the
:ref:`testing docs <topics-testing-management-commands>`.
+Overriding commands
+===================
+
+Django registers the built-in commands and then searches for commands in
+:setting:`INSTALLED_APPS` in reverse. During the search, if a command name
+duplicates an already registered command, the newly discovered command
+overrides the first.
+
+In other words, to override a command, the new command must have the same name
+and its app must be before the overridden command's app in
+:setting:`INSTALLED_APPS`.
+
+Management commands from third-party apps that have been unintentionally
+overridden can be made available under a new name by creating a new command in
+one of your project's apps (ordered before the third-party app in
+:setting:`INSTALLED_APPS`) which imports the ``Command`` of the overridden
+command.
+
Command objects
===============