diff options
| author | Timo Graham <timograham@gmail.com> | 2010-12-04 20:58:36 +0000 |
|---|---|---|
| committer | Timo Graham <timograham@gmail.com> | 2010-12-04 20:58:36 +0000 |
| commit | f6294c00e24c1084507b0217140f6ff320afd5a9 (patch) | |
| tree | 7bcf0fcc48b261235ba7c032334f2a69c9a171ad /docs | |
| parent | 84c283744fd52f59e595aefa2b49dedf50239616 (diff) | |
[1.2.X] Fixed #12407 - Document 'call_command' - thanks UloPe for the suggestion and adamv for the patch.
Backport of r14818 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/django-admin.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 7be09dcaf7..70faa3c90d 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1267,3 +1267,27 @@ distribution. It enables tab-completion of ``django-admin.py`` and See :doc:`/howto/custom-management-commands` for how to add customized actions. + + +========================================== +Running management commands from your code +========================================== + +.. function:: django.core.management.call_command(name, *args, **options) + +To call a management command from code use ``call_command``. + +``name`` + the name of the command to call. + +``*args`` + a list of arguments accepted by the command. + +``**options`` + named options accepted on the command-line. + +Examples:: + + from django.core import management + management.call_command('flush', verbosity=0, interactive=False) + management.call_command('loaddata', 'test_data', verbosity=0) |
