I need to provide an excel formatted data from django\'s database to visitors.
The only way I can think of is with these steps:
this worked for me
from openpyxl import Workbook, load_workbook
from openpyxl.writer.excel import save_virtual_workbook
wb = Workbook()
...
response = HttpResponse(content=save_virtual_workbook(wb), content_type='application/ms-excel')
response['Content-Disposition'] = 'attachment; filename=Inform.xlsx'
return response