|
@@ -4,6 +4,7 @@
|
|
import hashlib
|
|
import hashlib
|
|
import time
|
|
import time
|
|
import uuid
|
|
import uuid
|
|
|
|
+from io import BytesIO
|
|
|
|
|
|
import xlrd
|
|
import xlrd
|
|
import xlwt
|
|
import xlwt
|
|
@@ -690,9 +691,12 @@ class serveManagement(View):
|
|
col_value_list.insert(0, '否')
|
|
col_value_list.insert(0, '否')
|
|
wt_sheet.append(col_value_list)
|
|
wt_sheet.append(col_value_list)
|
|
|
|
|
|
- res = HttpResponse(content_type='application/octet-stream')
|
|
|
|
|
|
+ res = HttpResponse(content_type='application/vnd.ms-excel')
|
|
res['Content-Disposition'] = 'attachment; filename={}'.format(escape_uri_path(file.name))
|
|
res['Content-Disposition'] = 'attachment; filename={}'.format(escape_uri_path(file.name))
|
|
- wt_book.save(res)
|
|
|
|
|
|
+ output = BytesIO()
|
|
|
|
+ wt_book.save(output)
|
|
|
|
+ output.seek(0)
|
|
|
|
+ res.write(output.getvalue())
|
|
return res
|
|
return res
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|