title: Python Django - print within a loop, inside view function
body: <p>I'm trying to find a way to print within a loop, inside a view function.</p>
  
  <p>I want to do something like this: </p>
  
  <pre><code>def some_page(request):
      for i in range(1, 5):
          print("&lt;span&gt;current index: %s&lt;/span&gt;") % (i)
  </code></pre>
  
  <p>But I need to use HttpResponse, (or render, but from what I learned until now, HttpResponse is for small things, like this)</p>
  
  <p>so I need to do</p>
  
  <pre><code>return HttpResponse("&lt;span&gt;current...")
  </code></pre>
  
  <p>Which will not works - because <code>return</code> will end the function.</p>
  
  <p>So how can i do function that will prints within loop ? (like the example above)</p>
  
  <p>*With Python, not in the template (not Jinja)</p>
  
  <p>Thanks in advance.</p>