from io import BytesIO
from django.utils.encoding import escape_uri_path
            
            bytes_file = BytesIO()
			f.write(bytes_file)
            bytes_file.seek(0)

            file_name = "订单汇总.xls"
            response = StreamingHttpResponse(bytes_file)
            response['Content-Type'] = 'application/vnd.ms-excel'
            response['Content-Disposition'] = 'attachment;filename={}'.format(escape_uri_path(file_name))
            # bytes_file.close()
            return response
        resp = unified_response(code=status.RequestErr, message='请求数据不存在')
        return Response(resp)