Я нашел то, что мне нужно, в ответе по одной из ссылок, которые Андре Миллер предоставил.
Я обнаружил, что возможно передать итератор в HttpResponse, поэтому я использовал этот код, и он работал:
def import_iter():
""" Used to return output as it is generated """
# First return the template
t = loader.get_template('main/qimport.htm')
c = Context()
yield t.render(c)
# Now process the files
if req.method == 'POST':
location = req.POST['location']
if location:
for finfo in import_location(location):
yield finfo+"<br/>"
return HttpResponse(import_iter())