Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #12407 - Document 'call_command' - thanks UloPe for the suggest…

…ion and adamv for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 097072aee4ff3ebee0373cb996b9ee49e35400f0 1 parent 00f36e0
@timgraham timgraham authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 docs/ref/django-admin.txt
View
24 docs/ref/django-admin.txt
@@ -1338,3 +1338,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)
Please sign in to comment.
Something went wrong with that request. Please try again.