V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iugo
V2EX  ›  反馈

page.py 中增加页面却无法显示,到底哪儿出问题呀?

  •  
  •   iugo · 2010-08-22 11:35:14 +08:00 · 5025 次点击
    这是一个创建于 4988 天前的主题,其中的信息可能已经有所发展或是发生改变。
    首先,增加模板 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
    2 条回复    1970-01-01 08:00:00 +08:00
    Livid
        1
    Livid  
    MOD
       2010-08-22 12:20:51 +08:00 via iPhone
    app.yaml
    iugo
        2
    iugo  
    OP
       2010-08-22 12:23:49 +08:00
    @Livid 噢…… O(∩_∩)O谢谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3525 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:43 · PVG 08:43 · LAX 17:43 · JFK 20:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.