Error in deployed GAE RequestHandler using Webapp2

China☆狼群 提交于 2019-12-06 15:53:11

I think response does not take unicode data, so you have to encode it first:

content = template.render(path, template_values)
self.response.out.write(content.encode('utf-8'))

Also I recommend Werkzeug. It works well on appengine and makes life so much easier. It helps to deal with request and response data, url routing, provides http exceptions, has great debugger for offline development and more. I think Werkzeug is a must to have for every python web dev in their toolbox.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!