diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-08-18 05:10:31 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-08-18 05:10:31 +0000 |
| commit | d743ccbc4b2e27a52cffa4a6c0e4b30a1eeb1651 (patch) | |
| tree | 693d12d50d816075c396478f2887ac8ca840741b /docs | |
| parent | 7fc5a3b2d256d6e87fb7fcfeba5a885aa1a45e67 (diff) | |
Added some initial documentation on adding customized commands to django-admin.py.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/django-admin.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/django-admin.txt b/docs/django-admin.txt index aea990c5dc..0424a69a0d 100644 --- a/docs/django-admin.txt +++ b/docs/django-admin.txt @@ -603,3 +603,32 @@ distribution. It enables tab-completion of ``django-admin.py`` and * Press [TAB] to see all available options. * Type ``sql``, then [TAB], to see all available options whose names start with ``sql``. + +Customized actions +================== + +**New in Django development version** + +If you want to add an action of your own to ``manage.py``, you can. +Simply add a ``management/commands`` directory to your application. +Each python file in that directory will be discovered and registered as +a command that can be executed as an action when you run ``manage.py``:: + + /fancy_blog + __init__.py + models.py + /management + __init__.py + /commands + __init__.py + explode.py + views.py + +In this example, ``explode`` command will be made available to any project +that includes the ``fancy_blog`` application in ``settings.INSTALLED_APPS``. + +The ``explode.py`` file has only one requirement -- it must define a class +called ``Command`` that extends ``django.core.management.base.BaseCommand``. + +For more details on how to define your own commands, look at the code for the +existing ``django-admin.py`` commands, in ``/django/core/management/commands``. |
