I have a method in my views.py that I've constructed with a http response
# # content-type of response
response = HttpResponse(content_type='application/ms-excel')
# #decide file name
response['Content-Disposition'] = 'attachment; filename="ThePythonDjango.xls"'
#adding new sheets and data
new_wb = xlwt.Workbook(encoding='utf-8')
new_wb.save(response)
This works fine if I only have response in my return But I also want to return a render
return render(request, 'uploadpage/upload.html', {"excel_data": seller_info, "message":message, "errormessage":errormessage})
I was wondering if there's a way to do that