title: Django Serve .XLSX File and force download
body: <p>I'm currently using openPYXL in order to open a template file within Django </p>
  
  <pre><code>    module_dir = os.path.dirname(__file__)  # get current directory
  file_path = os.path.join(module_dir, fileName)
  username = request.user.username
  workbook = load_workbook(file_path)
  worksheet = workbook.active
  </code></pre>
  
  <p>The file is then edited, and saved under a different name(This works fine, I can open the created file and it contains the information desired), however what I'm struggling with is serving this file to the user, I've tried various techniques such as shown below </p>
  
  <pre><code>workbook.save('EvalofSelf1.xlsx')
  response = HttpResponse()
  file_path = os.path.join(os.path.dirname(os.path.realpath(__name__)), 'EvalofSelf1.xlsx')
  response['X-Sendfile'] = file_path
  response['Content-Type'] = 'mimetype/submimetype'
  response['Content-Disposition'] = 'attachment; filename=%s.xlsx' % 'DownloadedEval'
  </code></pre>
  
  <p>All of which serve a file as requested, but the file contains no actual data, is 0kb in size and unopenable, how can I serve up the created file from my Django project directory, retaining all information stored within it?</p>