Author: timo Date: 2010-12-04 14:58:36 -0600 (Sat, 04 Dec 2010) New Revision: 14819
Modified: django/branches/releases/1.2.X/docs/ref/django-admin.txt Log: [1.2.X] Fixed #12407 - Document 'call_command' - thanks UloPe for the suggestion and adamv for the patch. Backport of r14818 from trunk. Modified: django/branches/releases/1.2.X/docs/ref/django-admin.txt =================================================================== --- django/branches/releases/1.2.X/docs/ref/django-admin.txt 2010-12-04 20:58:07 UTC (rev 14818) +++ django/branches/releases/1.2.X/docs/ref/django-admin.txt 2010-12-04 20:58:36 UTC (rev 14819) @@ -1267,3 +1267,27 @@ 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) -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.