title: Filling MS Word Template from Django
body: <p>I found some python docs relating to docxtpl at this link: </p>
  
  <p><a href="https://docxtpl.readthedocs.io/en/latest/" rel="nofollow noreferrer">https://docxtpl.readthedocs.io/en/latest/</a></p>
  
  <p>I followed the instruction and entered the code found at this site into a view and created the associated URL.  When I go to the URL I would like for a doc to be generated - but I get an error that no HTTP response is being returned.  I understand I am not defining one, but I am a bit confused about what HTTP response I need to define (I am still very new to this).  The MS word template that I have saved is titled 'template.docx'.</p>
  
  <p>Any help would be greatly appreciated! </p>
  
  <p>VIEWS.PY</p>
  
  <pre><code>def doc_test(request):
  
  
      doc = DocxTemplate("template.docx")
      context = { 'ultimate_consignee' : "World company" }
      doc.render(context)
      doc.save("generated_doc.docx")
  </code></pre>
  
  <p>I would like accessing this view to generate the doc, where the variables are filled with what is defined in the context above.</p>