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 파일이 발견됨). 나는 끝에 플러시를 시도했지만 도움이되지 않았다. SDK 및 해당 서버에서이 작업을 다시 수행 할 수 있습니다.
내가 누락 된 항목이 있습니까? 누군가 일어나고있는 일에 대한 아이디어가 있습니까? (내 설정에서 ../templates
이없는) ./templates
로 변경 디렉토리로, 그리고 보통 main
기능을 추가하고,이 스크립트는 어떤 임의의 URL에 app.yaml
할당 -
감사