Added configurations.management.call_command. Fix #72.

This commit is contained in:
Jannis Leidel 2015-01-06 21:38:08 +01:00
parent a8643a1af5
commit 98de57b27e
2 changed files with 18 additions and 1 deletions

View file

@ -2,4 +2,5 @@ from . import importer
importer.install(check_options=True)
from django.core.management import execute_from_command_line # noqa
from django.core.management import (execute_from_command_line, # noqa
call_command)

View file

@ -1,6 +1,22 @@
Cookbook
========
Calling a Django management command
-----------------------------------
.. versionadded:: 1.0
If you want to call a Django management command programmatically, say
from a script outside of your usual Django code, you can use the
equivalent of Django's :func:`~django.core.management.call_command` function
with django-configurations, too.
Simply import it from ``configurations.management`` instead::
from configurations.management import call_command
call_command('dumpdata', exclude=['contenttypes', 'auth'])
Envdir
------