webapp2는 webapp2.uri_for이 "템플릿에 전달할 수있는 독립 실행 형 uri_for 버전"이라고 말합니다. 완벽 해. 내가 장고 템플릿 렌더러에 전달하는 경우 다음과 같이 내가 대신템플릿에서 webapp2.uri_for를 사용하는 방법?
넣으면import webapp2
from google.appengine.ext.webapp import template
self.response.out.write(template.render(path,
{ 'webapp2': webapp2 }))
및 템플릿에 넣고
Please <a href="{{ webapp2.uri_for('contact') }}">send us
your feedback</a>.
애플 리케이션 엔진 1.7.0은
TemplateSyntaxError: Could not parse the remainder: '('contact')' from 'webapp2.uri_for('contact')'
말한다
Please <a href="{{ webapp2 }}">send us your feedback</a>.
module%20%27webapp2%27%20from%20%27/usr/local/google_appengine/lib/webapp2/webapp2.pyc%27%
그래서 나는 webapp2가 템플릿에 들어 있다는 것을 알고 있습니다.
어떻게 작동합니까?
아마도 내가 알고있는 것처럼 jinja2처럼 글로벌로 설정할 수 있습니까? http://stackoverflow.com/questions/7081250/webapp2-jinja2-how-can-i-get-uri-for-working-in-jinja2-views –