I have a function that fetches data from a server and I have taken it in dictionary format. Now I want run that function in django shell and generate that file in my local drive. Here is my program to generate excel, it has HttpResponse which I don't need so what changes do I need to make?
def to_excel(excelStr, filename):
""" To Generate Excel Sheets """
response = HttpResponse(excelStr, mimetype='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=%s.xls' \
% str(filename)
return response