import xlwt def tool_excel_export(self, request, obj, button): response = HttpResponse(mimetype="application/ms-excel") response['Content-Disposition'] = 'attachment; filename=file.xls' wb = xlwt.Workbook() ws = wb.add_sheet('Sheetname') ws.write(0, 0, 'Firstname') ws.write(0, 1, 'Surname') ws.write(1, 0, 'Hans') ws.write(1, 1, 'Muster') wb.save(response) return response