Ticket #12407: document-call-command.diff

File document-call-command.diff, 985 bytes (added by Adam Vandenberg, 14 years ago)
  • docs/ref/django-admin.txt

    diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
    index eeb5fee..821b37f 100644
    a b distribution. It enables tab-completion of ``django-admin.py`` and  
    13381338
    13391339
    13401340See :doc:`/howto/custom-management-commands` for how to add customized actions.
     1341
     1342
     1343==========================================
     1344Running management commands from your code
     1345==========================================
     1346
     1347.. function:: django.core.management.call_command(name, *args, **options)
     1348
     1349To call a management command from code use ``call_command``.
     1350
     1351``name``
     1352  the name of the command to call.
     1353
     1354``*args``
     1355  a list of arguments accepted by the command.
     1356
     1357``**options``
     1358  named options accepted on the command-line.
     1359
     1360Examples::
     1361
     1362      from django.core import management
     1363      management.call_command('flush', verbosity=0, interactive=False)
     1364      management.call_command('loaddata', 'test_data', verbosity=0)
Back to Top