所以我决定去对付龙卷风(http://www.tornardweb.org/),我已经做了很多,但是由于某些原因,每当我在视图上调用.generate()函数时,浏览器中就会生成一个空白页(自写()但是有效)
我的请求处理者:
class Index(tornado.web.RequestHandler):
def get(self):
loader = template.Loader(funcs.static_prefix("/templates/"))
#self.write("Hello, world") #This works!
loader.load("test.html").generate(this="hello") #This doesn't :(
我的模板(测试.html)公司名称:
^{pr2}$我的日志:
13:43:18 web.1 | started with pid 21876
13:43:20 web.1 | WARNING:root:404 GET /favicon.ico (::1) 0.48ms
正如您所看到的,如果出现错误,它将无声地失败
有人能帮忙吗?在
generate
不将呈现的模板写入输出。只需这样写:并确保在应用程序的配置选项中设置模板路径。在
相关问题 更多 >
编程相关推荐