mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
Added configurations.management.call_command. Fix #72.
This commit is contained in:
parent
a8643a1af5
commit
98de57b27e
2 changed files with 18 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue