首先,增加模板 tpl,desktop,spaces.html
然后在 page.py 中增加这样一段
class SpacesHandler(webapp.RequestHandler):
def get(self):
template_values = {}
template_values['rnd'] = random.randrange(1, 100)
note = GetKindByNum('Note', 17001)
if note is False:
note = GetKindByNum('Note', 1)
template_values['note'] = note
member = CheckAuth(self)
if member:
template_values['member'] = member
template_values['page_title'] = u'CLIAN › Spaces'
path = os.path.join(os.path.dirname(__file__), 'tpl', 'desktop', 'spaces.html')
output = template.render(path, template_values)
self.response.out.write(output)
在 def main(): 下增加一行
('/spaces', SpacesHandler),
但是访问 /spaces 却无效,显示空白。
测试网址:
www.clian.net/spaces