def stream_response(request):
    return StreamingHttpResponse(stream_response_generator())

def stream_response_generator():
    for x in range(1, 11):
        yield '%s\n' % x
time.sleep(1)
How to stream an HttpResponse with Django