I like to keep my handlers in a directory called "handlers", not in the root dir of the app. Because of that I have to change the default configuration of Jinja2, otherwise it will try to look up templates in "handlers/templates". So I change the path in my base handler like this:class BaseHandler(webapp2.RequestHandler):@webapp2.cached_propertydef jinja2(self):# Returns a Jinja2 renderer cached in the app registry.j2 = jinja2.get_jinja2(app=self.app)j2.config['template_path'] = join(dirname(dirname(__file__)), 'templates')return j2However, in spite of the @cached_property decorator, this code is called at every page request (tested by logging it) which bothers me.Why is the @cached_property decorator not working?Or what would be the proper way to configure Jinja2?Thanks,Gabor
> Notice that configuration is set primarily in the application. See:
Thank you very much, that has solved my issue!
Gabor