【发布时间】:2009-06-12 04:35:23
【问题描述】:
在 Google App Engine 中,我有以下代码,它显示了一个简单的 HTML 页面。
import os
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
class IndexHandler(webapp.RequestHandler):
def get(self):
template_values = { }
path = os.path.join(os.path.dirname(__file__), '../templates/index.html')
self.response.out.write(template.render(path, template_values))
问题是页面并不总是被渲染。 index.html 是一个简单的“Hello World!”。几次页面刷新后,页面正确显示(即找到了 index.html 文件......)。我试图在最后调用flush,但它没有帮助。我可以用 SDK 和他们的服务器重现这个。
我错过了什么吗?有人知道发生了什么吗?
谢谢
【问题讨论】: