from django.utils.encoding import escape_uri_path
response = HttpResponse(file_stream)
file_name = '{}'.format(filename) + '.xlsx' # file_name下载下来保存的文件名字
print('file_name:', file_name)
response['Content-Type'] = 'application/octet-stream'
response['Content-Disposition'] = "attachment;filename={}".format(escape_uri_path(file_name))
# from urllib import parse
# response['Content-Disposition'] = "attachment;filename={}".format(parse.quote(file_name))