2012-03-02 9 views
1

私はpythonとgoogleのアプリエンジンを使ってアプリケーションを作っていますが、アプリはlocalhostでこれまでOKでしたが、Googleのアプリエンジンランチャー次のページをレンダリングするためのGoogleのアプリエンジン:アップロードは「TemplateDoesNotExist:index.html」というエラーを投げます

Traceback (most recent call last): 
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__ 
    handler.get(*groups) 
    File "/base/data/home/apps/s~legacyexample01/1.357212630820400434/legacyexample.py", line 78, in get 
    self.response.out.write(template.render(path, template_values)) 
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/template.py", line 91, in render 
    t = _load_user_django(template_path, debug) 
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/template.py", line 113, in _load_user_django 
    template = django.template.loader.get_template(file_name) 
    File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/loader.py", line 79, in get_template 
    source, origin = find_template_source(template_name) 
    File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/loader.py", line 72, in find_template_source 
    raise TemplateDoesNotExist, name 
TemplateDoesNotExist: index.html 

私のコードは以下の通りです:

class MainPage(webapp.RequestHandler): 
    def get(self): 

     template_values = {} 

     path = os.path.join(os.path.dirname(__file__), "files/page/index.html") 
     self.response.out.write(template.render(path, template_values)) 

class RegisterPage(webapp.RequestHandler): 
    def get(self): 

     currentYear = datetime.datetime.now().year 
     firstYear = currentYear-100 
     template_values = { 
      "currentYear" : currentYear, 
      "firstYear" : firstYear, 
     } 

     path = os.path.join(os.path.dirname(__file__), "files/page/register.html") 
     self.response.out.write(template.render(path, template_values)) 

application = webapp.WSGIApplication([('/', MainPage),('/registration', RegisterPage),('/sign',RegistrationProccess) ], debug=True) 

私はジャンゴ1.3を使用してのpython 2.7は、問題の原因ということですか?助けてください、ここで

UPDATE が私のYAML configutration

application: legacyexample01 
version: 1 
runtime: python 
api_version: 1 

handlers: 
- url: /files/image 
    static_dir: files/image 

- url: /files/css 
    static_dir: files/css 

- url: /files/javascript 
    static_dir: files/javascript 

- url: /files/page 
    static_dir: files/page 

- url: /.* 
    script: legacyexample.py 
+0

登録ページは機能していますか、どちらも失敗していますか? – RLH

答えて

7

は、ファイル/ページ内のindex.htmlをテンプレートでもありますか?

編集:

YAMLファイルから

- url: /files/page 
    static_dir: files/page 

この宣言を削除してください。
静的ファイルではなく、.pyファイルからアクセスできるhtmlテンプレートファイルが必要です。

+0

はい、ローカルホストでも正常に動作します –

+0

あなたはhtmlファイルもアップロードしていますか? yamlファイルのskip_filesに何かがあるかもしれません。 – aschmid00

+0

yamlファイルにある私は、URLを見つけるためのハンドラーしか持っていません ここに私のアプリをデプロイするときのアプリエンジンは何ですか? 13個の静的ファイルをクローンします。 2つのアプリケーションファイルをクローンします。 1つのファイルとブロブをアップロードしています。 アップロードされた1つのファイルとブロブ –

関連する問題