Ticket #17625: 17625.diff

File 17625.diff, 1.5 KB (added by Grzegorz Nosek, 12 years ago)
  • docs/howto/custom-management-commands.txt

    diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
    index a844e32..1de256a 100644
    a b command for the ``polls`` application from the  
    99:doc:`tutorial</intro/tutorial01>`.
    1010
    1111To do this, just add a ``management/commands`` directory to the application.
    12 Each Python module in that directory will be auto-discovered and registered as
    13 a command that can be executed as an action when you run ``manage.py``::
     12Each Python module in that directory will be auto-discovered. Modules having
     13names not starting with an underscore will be registered as commands that can be
     14executed as an action when you run ``manage.py``::
    1415
    1516    polls/
    1617        __init__.py
    a command that can be executed as an action when you run ``manage.py``::  
    1920            __init__.py
    2021            commands/
    2122                __init__.py
     23                _private.py
    2224                closepoll.py
    2325        tests.py
    2426        views.py
    a command that can be executed as an action when you run ``manage.py``::  
    2628In this example, the ``closepoll`` command will be made available to any project
    2729that includes the ``polls`` application in :setting:`INSTALLED_APPS`.
    2830
     31The ``_private.py`` module will not be available as a management command.
     32
    2933The ``closepoll.py`` module has only one requirement -- it must define a class
    3034``Command`` that extends :class:`BaseCommand` or one of its
    3135:ref:`subclasses<ref-basecommand-subclasses>`.
Back to Top