summaryrefslogtreecommitdiff
path: root/docs/howto
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2012-03-02 17:13:53 +0000
committerCarl Meyer <carl@oddbird.net>2012-03-02 17:13:53 +0000
commit3ed0b6ed64ff7a69644d1c1eacfb62b0aedadf71 (patch)
treed7e5abe78e8ef6738d1ed7ae54664c9dec25037d /docs/howto
parentfcaf8eae14d0a7f884328bdf0238dd1e2881c681 (diff)
Fixed #17799 - Documented that the execute() method of a management command is not suitable for calling the command from code; call_command should be used instead. Thanks kacah222 for the report and claudep for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17629 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/howto')
-rw-r--r--docs/howto/custom-management-commands.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
index e49e2b632a..74b67b2ac2 100644
--- a/docs/howto/custom-management-commands.txt
+++ b/docs/howto/custom-management-commands.txt
@@ -243,6 +243,11 @@ the :meth:`~BaseCommand.handle` method must be implemented.
:class:`CommandError`, intercept it and print it sensibly to
stderr.
+.. admonition:: Calling a management command in your code
+
+ ``execute()`` should not be called directly from your code to execute a
+ command. Use :ref:`call_command <call-command>` instead.
+
.. method:: BaseCommand.handle(*args, **options)
The actual logic of the command. Subclasses must implement this method.