From b1ac329ba9bbcba90d8ced7e16909ed169b1d16e Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Wed, 7 Nov 2012 18:31:14 +0100 Subject: [PATCH] Fixed #19115 -- Documented stdout/stderr options for call_command Thanks d1ffuz0r for helping with the patch. --- docs/ref/django-admin.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index e0b08450e9..a5ed37f25f 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1469,3 +1469,12 @@ Examples:: from django.core import management management.call_command('flush', verbosity=0, interactive=False) management.call_command('loaddata', 'test_data', verbosity=0) + +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('/tmp/command_output') as f: + management.call_command('dumpdata', stdout=f)