title: read django data from model and write it using xlsxwriter
body: <p>I need to extract all the data from a model(called Aged) I have and trigger a function to export it as a .xls file. I have found xlsxWriter not sure if I'm in the right path, is there a way I can just call my full model and write it into a file?</p>
  
  <p>This is what I got on my views.py:</p>
  
  <pre><code>def writetoexcel(Reportdata):
      output = StringIO.StringIO()
      workbook = xlsxwriter.Workbook('Reporte3a4.xlsx', 
                                     {'constant_memory': True})
      worksheet = workbook.add_worksheet()
  
      bold = workbook.add_format({'bold': True})
  
      worksheet.write('A1', 'Priority', bold)
      worksheet.write('B1', 'PO Number', bold)
  
      Reporte = Reporte3a5.objects.all()
  
      row = 1
      col = 0
  
      for data in Reporte:
          worksheet.write(row, col, data.secondary_priority)
          worksheet.write(row, col + 1, data.po_number)
          worksheet.write(row, col + 2, data.ctb_status)
  
      workbook.close()
      xlsx_Data = output.getvalue()
      return  xlsx_Data
  </code></pre>