def get(self): # greeting = self.get_argument('greeting', 'Hello') # self.write(greeting + ', welcome you to read: www.itdiffer.com') # self.render("index.html") usernames = mrd.select_columns(table="users", column="username") one_user = usernames[0][0] self.render("index.html", user=one_user)
def get(self): # greeting = self.get_argument('greeting', 'Hello') # self.write(greeting + ', welcome you to read: www.itdiffer.com') # self.render("index.html") usernames = mrd.select_columns(table="users",column="username") one_user = usernames[0][0] self.render("index.html", user=one_user)
def get(self): usernames = mrd.select_columns(table="users",column="username,email") #one_user = usernames[0][0] one_user = usernames print "type(one_user)" self.render("index.html", user=one_user)
def get(self): usernames = mrd.select_columns(table="users",column="username") one_user = usernames[0][0] self.render("index.html", user=one_user)
def get(self): user_infos = mrd.select_columns(table="news",column="*") self.render("list.html", new = user_infos)
def get(self): usernames = mrd.select_columns(table="users", column="username") one_user = usernames[0][0] self.render("index.html", user=one_user)
def get(self): username = mrd.select_columns(table="users", column="username") one_user = username[0][0] # 其中user=one_user的作用就是传递对象到模板 self.render("index.html", user=one_user)
def get(self): usernames = mrd.select_columns(table="users", column="username") one_user = usernames[0][0] self.render("index.html", user=one_user) #render() 函数的功能在于向请求者反馈网页模板,并且向模板中传递数值
def get(self): usernames = mrd.select_columns(table='users', column='username') one_user = usernames[0][0] self.render('index.html', user=one_user) #反馈网页模板
def post(self): self.set_header("Content-Type", "application/json") user_infos = mrd.select_columns(table="user", column="*") self.write(json.dumps(user_infos))
def get(self): usernames = mrd.select_columns(table='users',column='username') one_user = usernames[0][0] self.render('index.html',user=one_user)