Redirecting django manage.py output (in windows) to a text file

I'm trying to redirect the output from manage.py to a text file, but only some output is getting redirected to the text file. How do I redirect all output to the text file?

My command prompt:

C:\Development\web-py\p1st2\pianos1st-system>python manage.py test > test_results.txt
.....................................................................................................................
----------------------------------------------------------------------
Ran 117 tests in 2.026s

OK

My test_results.txt file:

Creating test database for alias 'default'...
Destroying test database for alias 'default'...

I'm using Windows 7 32bit SP1 and Django SVN.

Answers


Certain types of console messages will bypass the output redirection (or whatever using ">" is called). I noticed that sys.stderr.write() for instance did this.

Adding a "2>&1" at the end helps with this:

python manage.py test purchaseplans > test_results.txt 2>&1

Edit: Explanation of what is going on: http://en.wikipedia.org/wiki/Redirection_(computing)#Redirecting_to_and_from_the_standard_file_handles


Need Your Help

Highcharts doesn't display series with lots of data points

highcharts highstock

I have a chart that I would like to display based on a date range from the user. This particular chart has a data point for every 15 minutes. So there can be a lot of data points for each series if a

Conditional Action in SSRS

reporting-services ssrs-2008 iif-function iif

I want my textbox to have an action ONLY if the condition is true, otherwise no action. This is what I have as my current action expression for going to another report: