Tornado框架渲染空白页面

2024-10-02 00:36:17 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我决定去对付龙卷风(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

正如您所看到的,如果出现错误,它将无声地失败

有人能帮忙吗?在


Tags: 函数orgself视图httphtmlwww浏览器

热门问题