summaryrefslogtreecommitdiff
path: root/docs/ref/django-admin.txt
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2023-02-28 20:53:28 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-03-01 13:03:56 +0100
commit14459f80ee3a9e005989db37c26fd13bb6d2fab2 (patch)
treeeb62429ed696ed3a5389f3a676aecfc6d15a99cc /docs/ref/django-admin.txt
parent6015bab80e28aef2669f6fac53423aa65f70cb08 (diff)
Fixed #34140 -- Reformatted code blocks in docs with blacken-docs.
Diffstat (limited to 'docs/ref/django-admin.txt')
-rw-r--r--docs/ref/django-admin.txt18
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index 3a766d748a..56e29861ee 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -2097,9 +2097,9 @@ Examples::
from django.core import management
from django.core.management.commands import loaddata
- management.call_command('flush', verbosity=0, interactive=False)
- management.call_command('loaddata', 'test_data', verbosity=0)
- management.call_command(loaddata.Command(), 'test_data', verbosity=0)
+ management.call_command("flush", verbosity=0, interactive=False)
+ management.call_command("loaddata", "test_data", verbosity=0)
+ management.call_command(loaddata.Command(), "test_data", verbosity=0)
Note that command options that take no arguments are passed as keywords
with ``True`` or ``False``, as you can see with the ``interactive`` option above.
@@ -2107,14 +2107,14 @@ with ``True`` or ``False``, as you can see with the ``interactive`` option above
Named arguments can be passed by using either one of the following syntaxes::
# Similar to the command line
- management.call_command('dumpdata', '--natural-foreign')
+ management.call_command("dumpdata", "--natural-foreign")
# Named argument similar to the command line minus the initial dashes and
# with internal dashes replaced by underscores
- management.call_command('dumpdata', natural_foreign=True)
+ management.call_command("dumpdata", natural_foreign=True)
# `use_natural_foreign_keys` is the option destination variable
- management.call_command('dumpdata', use_natural_foreign_keys=True)
+ management.call_command("dumpdata", use_natural_foreign_keys=True)
Some command options have different names when using ``call_command()`` instead
of ``django-admin`` or ``manage.py``. For example, ``django-admin
@@ -2125,7 +2125,7 @@ passed to ``parser.add_argument()``.
Command options which take multiple options are passed a list::
- management.call_command('dumpdata', exclude=['contenttypes', 'auth'])
+ management.call_command("dumpdata", exclude=["contenttypes", "auth"])
The return value of the ``call_command()`` function is the same as the return
value of the ``handle()`` method of the command.
@@ -2136,5 +2136,5 @@ Output redirection
Note that you can redirect standard output and error streams as all commands
support the ``stdout`` and ``stderr`` options. For example, you could write::
- with open('/path/to/command_output', 'w') as f:
- management.call_command('dumpdata', stdout=f)
+ with open("/path/to/command_output", "w") as f:
+ management.call_command("dumpdata", stdout=f)