mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Fixed #17625 -- Mention in the management command docs that modules with an underscore prefix are ignored and not dissplayed in the list of commands.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17440 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
62efdcb037
commit
62dc16dcd8
@ -9,8 +9,9 @@ command for the ``polls`` application from the
|
|||||||
:doc:`tutorial</intro/tutorial01>`.
|
:doc:`tutorial</intro/tutorial01>`.
|
||||||
|
|
||||||
To do this, just add a ``management/commands`` directory to the application.
|
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
|
Each Python module in that directory will be auto-discovered. Modules having
|
||||||
a command that can be executed as an action when you run ``manage.py``::
|
names not starting with an underscore will be registered as commands that can be
|
||||||
|
executed as an action when you run ``manage.py``::
|
||||||
|
|
||||||
polls/
|
polls/
|
||||||
__init__.py
|
__init__.py
|
||||||
@ -19,6 +20,7 @@ a command that can be executed as an action when you run ``manage.py``::
|
|||||||
__init__.py
|
__init__.py
|
||||||
commands/
|
commands/
|
||||||
__init__.py
|
__init__.py
|
||||||
|
_private.py
|
||||||
closepoll.py
|
closepoll.py
|
||||||
tests.py
|
tests.py
|
||||||
views.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
|
In this example, the ``closepoll`` command will be made available to any project
|
||||||
that includes the ``polls`` application in :setting:`INSTALLED_APPS`.
|
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
|
The ``closepoll.py`` module has only one requirement -- it must define a class
|
||||||
``Command`` that extends :class:`BaseCommand` or one of its
|
``Command`` that extends :class:`BaseCommand` or one of its
|
||||||
:ref:`subclasses<ref-basecommand-subclasses>`.
|
:ref:`subclasses<ref-basecommand-subclasses>`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user