title: Django to serve generated excel file
body: <p>I looked at the various questions similar to mine, but I could not find anything a fix for my problem.</p>
  
  <p>In my code, I want to serve a freshly generated excel file residing in my app directory in a folder named files</p>
  
  <pre><code>excelFile = ExcelCreator.ExcelCreator("test")
  excelFile.create()
  response = HttpResponse(content_type='application/vnd.ms-excel')
  response['Content-Disposition'] = 'attachment; filename="test.xls"'
  return response
  </code></pre>
  
  <p>So when I click on the button that run this part of the code, it sends to the user an empty file. By looking at my code, I can understand that behavior because I don't point to that file within my response...</p>
  
  <p>I saw some people use the file wrapper (which I don't quite understand the use). So I did like that:</p>
  
  <pre><code>response = HttpResponse(FileWrapper(excelFile.file),content_type='application/vnd.ms-excel')
  </code></pre>
  
  <p>But then, I receive the error message from server : A server error occurred.  Please contact the administrator.</p>
  
  <p>Thanks for helping me in my Django quest, I'm getting better with all of your precious advices!</p>