Пример #1
0
 def get(self):
     print("get /")
     self.render("index.html", site=website.genSite("read"))
Пример #2
0
 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"))
Пример #3
0
__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))