def get(self): print("get /") self.render("index.html", site=website.genSite("read"))
def get(self): user = self.get_secure_cookie("user") if user.decode("utf-8") == "shaoqiu": self.render("index.html", site=website.genSite("write")) else: self.render("index.html", site=website.genSite("read"))
__author__ = "shaoqiu" import tornado.template import website site = website.genSite("read") loader = tornado.template.Loader("templates") with open("index.html", 'wb') as fd: fd.write(loader.load("index.html").generate(site = website))