I am currently returning a response page as a string but I also want to pass it as an excel file. I am having trouble doing both.
This is my views.py file:
response = HttpResponse(htmlString)
response = HttpResponse(mimetype='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=example1.xls'
book.save(response)
return response
This only gives me the excel file and not the HtmlString which is because I am reassigning response but I dont know how to include both paramaters.
THanks in advance!!