title: docx file downloaded from Django is corrupt
body: <p>Im trying to take user input from a form and then using that data to create a document using python docx module. But the downloaded file is not opening in MS word. It says the file is corrupt. Can someone help me with this? </p>
  
  <pre><code>def resume_form(request):
  form = forms.resume()
  
  if request.method == 'POST':
      form = forms.resume(request.POST)
      if form.is_valid():
          document = Document()
          document.add_heading(str(form.cleaned_data['full_name']),0)
          document.add_heading('Summary', 1)
          document.add_paragraph(str(form.cleaned_data['summary']))
  
          f = io.BytesIO()
          document.save(f)
          length = f.tell()
          f.seek(0)
          response = HttpResponse(document, content_type='application/vnd.openxmlformats-officedocument.wordprocessingml.document')
          response['Content-Disposition'] = 'attachment; filename=download.docx'
          response['Content-Length'] = length
          #document.save(response)
          return response
  
  return render(request, 'sample_app/index.html', {'form' : form})
  </code></pre>