flask写tag页面,URL中有中文访问就出错。flask运行在windows2012 iis8下

buzul 2017-04-05 06:40:11
flask写tag页面,URL中有中文访问就出错。flask运行在windows2012 iis8下。在linux就没有这种问题
感觉的是编码的问题,可是各种编码解码都上了,还是出错。


@app.route('/s/<string:name>')
@app.route('/s/<string:name>/<int:pn>')
def tags(name,pn=1):
es = es.search(index="xxxx", body={'query':{'match':{'title':name}}}, size=20)
res = res['hits']['hits']
return render_template('tags.html', res=res)
...全文
762 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
anaf 2017-05-03
  • 打赏
  • 举报
回复
我还在研究如何用iis部署 确实 比较罗嗦 所以这个中文的更是深坑 直接借鉴学习

8,327

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 IIS
社区管理员
  • IIS
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧