我创建了新page,为什么会空白?

2010-08-18 17:17:40 +08:00
 lin
http://geekaa3.appspot.com/

底部的 “Day Day Up” 和 “Plan”

我是照着原来的 mission 页面改的。
我把 page.py 里面 mission那段,改成:

class PlanHandler(webapp.RequestHandler):
def get(self):
template_values = {}
template_values['site_name'] = SITE_NAME
template_values['site_tagline'] = SITE_TAGLINE
template_values['site_description'] = SITE_DESCRIPTION
template_values['site_footnote'] = SITE_FOOTNOTE
template_values['rnd'] = random.randrange(1, 100)
note = GetKindByNum('Note', 5)
if note is False:
note = GetKindByNum('Note', 6)
template_values['note'] = note
member = CheckAuth(self)
if member:
template_values['member'] = member
template_values['page_title'] = u' › Plan'
path = os.path.join(os.path.dirname(__file__), 'tpl', 'desktop', 'plan.html')
output = template.render(path, template_values)
self.response.out.write(output)

class UpdatesHandler(webapp.RequestHandler):
def get(self):
template_values = {}
template_values['site_name'] = SITE_NAME
template_values['site_tagline'] = SITE_TAGLINE
template_values['site_description'] = SITE_DESCRIPTION
template_values['site_footnote'] = SITE_FOOTNOTE
template_values['rnd'] = random.randrange(1, 100)
note = GetKindByNum('Note', 7)
if note is False:
note = GetKindByNum('Note', 8)
template_values['note'] = note
member = CheckAuth(self)
if member:
template_values['member'] = member
template_values['page_title'] = u' › Updates'
path = os.path.join(os.path.dirname(__file__), 'tpl', 'desktop', 'updates.html')
output = template.render(path, template_values)
self.response.out.write(output)
4329 次点击
所在节点    Project Babel
3 条回复
lin
2010-08-18 17:18:26 +08:00
抱歉,超过2000字发不出,我拆分两段。

然后 webapp.WSGIApplication 那边,我也加了:

application = webapp.WSGIApplication([
('/about', AboutHandler),
('/faq', FAQHandler),
('/plan', PlanHandler),
('/updates', UpdatesHandler),
('/advertise', AdvertiseHandler)
],
debug=True)
util.run_wsgi_app(application)

当然。我用 /tpl/desktop/mission.html 作为模板,复制出了 /tpl/desktop/plan.html 和 /tpl/desktop/updates.html

我是不是哪步做漏了?或者是有什么错误?希望得到指正。

谢谢!

另外我想问一下,

note = GetKindByNum('Note', 7)
if note is False:
note = GetKindByNum('Note', 8)

这样做的目的是?
lin
2010-08-18 18:06:37 +08:00
最后那顺便一问想想觉得有点白痴。忽视那一问。但是前面的我还想请教。
lin
2010-08-18 18:54:50 +08:00
已经解决了。我SB。

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

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

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

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

© 2021 V2EX