summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/howto/custom-management-commands.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
index a844e32817..1de256a169 100644
--- a/docs/howto/custom-management-commands.txt
+++ b/docs/howto/custom-management-commands.txt
@@ -9,8 +9,9 @@ command for the ``polls`` application from the
:doc:`tutorial</intro/tutorial01>`.
To do this, just add a ``management/commands`` directory to the application.
-Each Python module in that directory will be auto-discovered and registered as
-a command that can be executed as an action when you run ``manage.py``::
+Each Python module in that directory will be auto-discovered. Modules having
+names not starting with an underscore will be registered as commands that can be
+executed as an action when you run ``manage.py``::
polls/
__init__.py
@@ -19,6 +20,7 @@ a command that can be executed as an action when you run ``manage.py``::
__init__.py
commands/
__init__.py
+ _private.py
closepoll.py
tests.py
views.py
@@ -26,6 +28,8 @@ a command that can be executed as an action when you run ``manage.py``::
In this example, the ``closepoll`` command will be made available to any project
that includes the ``polls`` application in :setting:`INSTALLED_APPS`.
+The ``_private.py`` module will not be available as a management command.
+
The ``closepoll.py`` module has only one requirement -- it must define a class
``Command`` that extends :class:`BaseCommand` or one of its
:ref:`subclasses<ref-basecommand-subclasses>`.