python引号的意义_为什么python双引号在文件名中转换为连字符?

this question的研究看来,它实际上是浏览器进行编码/转义.我用

cURL来确认Django本身没有逃脱这些标题.首先,我设置了一个最小的测试视图:

# views.py

def index(request):

response = render(request, 'template.html')

response['Content-Disposition'] = 'inline; filename=constant"a_b".html'

return response

然后跑了:

carl@chaffinch:~$HEAD http://localhost:8003

200 OK

Date: Thu, 16 Aug 2012 19:28:54 GMT

Server: WSGIServer/0.1 Python/2.7.3

Vary: Cookie

Content-Type: text/html; charset=utf-8

Client-Date: Thu, 16 Aug 2012 19:28:54 GMT

Client-Peer: 127.0.0.1:8003

Client-Response-Num: 1

Content-Disposition: inline; filename=constant"a_b".html

查看标题:filename =常量“a_b”.html.报价仍在那里!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值