localhost에서 내 Google App Engine 앱을 시작하려고했는데 장고 오류가 발생했습니다.Google App Engine에서 Django 템플릿 구문 오류
"TemplateSyntaxError : 존재하지 않기 때문에 템플릿 '기본/_base.html가'확장 할 수 없습니다"
가 나는/템플릿에서 템플릿을 넣어, 다음 _base.html & 된 index.html에서/템플릿/기본. 감사! 에밀 proudn00b.com@ 오류 :
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 511, in __call__
handler.get(*groups)
File "/Users/emilepetrone/code/thebuswheel/main.py", line 65, in get
outstr = template.render(temp, { 'path': path })
….
…..
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django/django/template/loader_tags.py", line 58, in get_parent
raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent
TemplateSyntaxError: Template 'base/_base.html' cannot be extended, because it doesn't exist
참조 :
데프 취득 (자기) :
path = self.request.path
temp = os.path.join(
os.path.dirname(__file__),
'templates' + path)
if not os.path.isfile(temp):
temp = os.path.join(
os.path.dirname(__file__),
'templates/base/index.html')
outstr = template.render(temp, { 'path': path })
self.response.out.write(outstr)
나는 base/_base.html 파일을 가지고 있으며, 이것이 유일한 템플릿 파일입니다. 좌절 – Emile
의 일부를 정의하면 템플릿과 yaml 구성 파일을 표시하는 데 도움이 될 수도 있습니다. :-) – jps
파일이 stackoverflow에 너무 길어서 블로그에 게시했습니다 ... http://www.proudn00b.com/post/976956081/buswheel-files-4-error – Emile