[Fixed]-Redirecting django manage.py output (in windows) to a text file

26đź‘Ť

âś…

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

Leave a comment