title: Django progress bar
body: <p>I'm using Django to upload a file and kick of an ETL job using <pre>subprocess</pre></p>
  
  <p>The job takes roughly 15 seconds to run, and rather than having the user think the page is frozen, I'd like to show a <a href="http://twitter.github.com/bootstrap/components.html#progress" rel="nofollow">progress bar</a>.</p>
  
  <p>I can figure out the AJAX to update the progress bar, but what I don't know how to do is return an HttpResponse while subprocess is running.  Perhaps threading is the solution?  I don't have any experience there.  Can someone give me some guidance?</p>
  
  <p>Here's the view:</p>
  
  <pre><code>def start_job(request):
      if request.method == 'POST':
          form = UploadForm(request.POST, request.FILES)
          if form.is_valid() and form.is_multipart():
              save_file(form.cleaned_data['file'])
              subprocess.call(["Kitchen.bat", "/file:job.kjb"])
              return HttpResponseRedirect('/success/')
      else:
          form = UploadForm()
      return render_to_response('template.html')
  </code></pre>