在tornado.web中,有关于autoescape方法的获取,发现在settings中修改即可。
于是在settings中添加 "autoescape":None
问题得以解决。
settings 配置
settings = { "debug" : True, # will auto reload "cookie_secret": "jNU893FLQp3vauUciqEQZbTtBSApVSp4IvNZj19V/Vo=", "login_url" : "/login", "xsrf_cookies" : True, "static_url_prefix" : "/static/", "template_path" : os.path.join( workpath, "template"), "static_path" : os.path.join( workpath, "static"), "autoescape" : None }
application = tornado.web.Application([ (r"/",MainHandler), (r"/login",loginHandler), ],**settings) #这儿传入