I have a Django management team that does quite a bit of processing, so I have a percentage of its progress. I would like to use the technique described in the answers here or here . I know from the Django docs that sys.stdoutneed to be replaced with self.stdoutwhen used inside the control command, m is still out of luck. This is python 2.7, so I can not give endkwarg print. Here is one of the things I tried in the handleCommand object:
i = 0
for thing in query:
self.stdout.write("\r%%%s" % (100 * float(i) / float(query.count()))
i += 1
I tried several other methods described in answers to similar questions, including the use of ANSI escape sequences . Is there anything special about how Django control commands output output? How can I achieve the effect I'm looking for?
stett source
share