Say I have this template with an extends call:
foo.html:
{% extends 'base.html' %}
I load it:
jinja2_env.get_template('foo.html', globals=my_globals}
This causes two calls to Environment._load_template: First, for foo.html, the for base.html.
Environment._load_template caches both templates.
The crucial point is that for the second call, the "globals" parameter to Environment._load_template is missing my_globals.
If I now attempt to load the base template directly:
jinja2_env.get_template('base.html', globals=my_globals}
The cache will be used, and my globals will not be available.
Using 2.7.2
Say I have this template with an extends call:
foo.html:
I load it:
This causes two calls to
Environment._load_template: First, forfoo.html, the forbase.html.Environment._load_templatecaches both templates.The crucial point is that for the second call, the "globals" parameter to
Environment._load_templateis missingmy_globals.If I now attempt to load the base template directly:
The cache will be used, and my globals will not be available.
Using 2.7.2