tornado web需求示例

2024-04-25 01:56:58 发布

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

我正在制作一个龙卷风应用程序的样本。对于第一个方法,我希望它返回字符串“OK”,而不是呈现模板。我将如何执行以下操作:

class IndexHandler(tornado.web.RequestHandler):
    """Regular HTTP handler to serve the ping page"""
    def get(self):
        self.render('Hi') # expects template instead of string -- how to do string?

Tags: to方法字符串self模板web应用程序string