Can you use the verbatim tag with Django 1.5 on App Engine?

∥☆過路亽.° 提交于 2019-12-10 16:01:36

问题


In my app.yaml file I have:

- name: django
   version: "1.5"

which I assume means, use Django 1.5. 1.5 includes the verbatim tag, but when I try to use it I get:

TemplateSyntaxError: 'verbatim' is not a valid tag library: Template library verbatim not found, tried google.appengine._internal.django.templatetags.verbatim

Any idea how to enable this feature or is it just not included with app engine, I am using 1.8.9. Thanks!


回答1:


I don't think it works. When I tried to do this, I got this traceback:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
...
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\_internal\django\template\__init__.py", line 333, in invalid_block_tag
    raise self.error(token, "Invalid block tag: '%s'" % command)
TemplateSyntaxError: Invalid block tag: 'verbatim'

Looking at the source C:\Program Files (x86)\Google\google_appengine\google\appengine\_internal\django\__init__.py you can see the version number in the first line:

VERSION = (1, 2, 5, 'final', 0)

This tells me that the appengine is using Django version 1.2.5 for the templating. I do not know if these means you can deploy the app to production and it will somehow use 1.5, but I couldn't get it to work locally. (Note that this was specifying Django 1.5 and Webapp 2.5.2 in my app.yaml using the Google App Engine Launcher 1.9.17)



来源:https://stackoverflow.com/questions/21642321/can-you-use-the-verbatim-tag-with-django-1-5-on-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!