I am creating a xlsx file in memory using openpyxl and i need to serve it to the user. This is what i'm using now in my views.py and it's working but it's serving me a xls file and that's not completely correct, i need it to be XLSX and i would also like to be able to set the name of the downloaded file.
return HttpResponse(save_virtual_workbook(export_file), content_type='application/vnd.ms-excel')
I did check out this question and this question but they don't help me too much.