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

2010-08-22 11:35:14 +08:00
 iugo
首先,增加模板 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
5032 次点击
所在节点    反馈
2 条回复
Livid
2010-08-22 12:20:51 +08:00
app.yaml
iugo
2010-08-22 12:23:49 +08:00
@Livid 噢…… O(∩_∩)O谢谢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1930

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX