を動作しません。 /project_dir/html/mt.htmlファイルからロードされます。 しかし、それは次のエラーで失敗します。同じ時間でGAEテンプレートは、私は私のsettins.pyに次のコードを持っている
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 701, in __call__
handler.get(*groups)
File "D:\ap\pz4\pz4\main.py", line 33, in get
x8= template.render(fn, {'some_content':blabla,})
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\template.py", line 91, in render
t = _load_user_django(template_path, debug)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\template.py", line 113, in _load_user_django
template = django.template.loader.get_template(file_name)
File "C:\Program Files (x86)\Google\google_appengine\lib\django_1_3\django\template\loader.py", line 157, in get_template
template, origin = find_template(template_name)
File "C:\Program Files (x86)\Google\google_appengine\lib\django_1_3\django\template\loader.py", line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: mt.html
私は直接フォルダ定義を使用して、それを呼び出したとき、それは、正常に動作します:
r = template.render(os.path.join(os.path.dirname(__file__),'html/mt.html').replace("\\","/"),{'some_content':blabla,})
GAEは、1.6.3(ローカル)で、 djangoのバージョン(use_library( 'django'、 'xxx')を使用)は0.96,1.2,1.3でチェックされ、結果は同じです。
私は間違っていますか? DjangoはAPP_NAME /テンプレート/ APP_NAME/template.htmlでテンプレート(ええ、APP_NAMEが繰り返さ)
を探し、デフォルトで
私は、次のフォルダに "mt.html" を置く: app_root app_root/htmlの app_root/HTML/APP_NAME が、それはまだ動作していません。 – user1276220
ドキュメントはあなた自身を助けるかもしれません。 https://docs.djangoproject。com/ja/dev/ref/templates/api/ 私は誤ったトラックにいるように見えますが、テンプレートでサブフォルダを使用していましたが、スタックトレースに指定された適切な場所にtemplate_pathまたはfile_nameのいずれかを出力する行を追加することで、デバッグが非常に簡単になります。 – dragonx