def GET(self): log.debug('headers %s', self.req.headers()) log.debug('get cookie %s' % self.req.cookie) with get_connection_exception('test') as db: data = db.query('show processlist') t = str(time.time()) log.debug('set cookie time: %s', t) self.resp.set_cookie('time', t, expires=int(time.time()) + 20) self.write(template.render('index.html', data=data))
def render(self, *args, **kwargs): if template.render: kwargs.update({'_handler': self}) self.write(template.render(*args, **kwargs))