Webapp2 Custom Tags

I am migrating from webapp1 to webapp2 and from python 2.5 to python2.7 I had some custom tags that I used with

webapp.template.register_template_library('common.templatetags')

and registered:

from google.appengine.ext.webapp import template
register = template.create_template_register()

and the corresponding decorator and everything else worked fine

now i need to use webapp2 which does not have a .register template .....

I tried to do it this way: http://www.john-smith.me/Tag/webapp2 but this did not work

thank

+3
source share
1 answer

using add_to_builtins ()

from django.template.loader import add_to_builtins

add_to_builtins('myapp.templatetags.mytagslib')
-1
source

All Articles