forked from orbit-oss/flask
added create_jinja_loader
This commit is contained in:
parent
b49de851d9
commit
00c5b7a937
3 changed files with 23 additions and 1 deletions
10
flask/app.py
10
flask/app.py
|
|
@ -352,7 +352,15 @@ class Flask(_PackageBoundObject):
|
|||
options = dict(self.jinja_options)
|
||||
if 'autoescape' not in options:
|
||||
options['autoescape'] = self.select_jinja_autoescape
|
||||
return Environment(loader=_DispatchingJinjaLoader(self), **options)
|
||||
return Environment(loader=self.create_jinja_loader(), **options)
|
||||
|
||||
def create_jinja_loader(self):
|
||||
"""Creates the loader for the Jinja2 environment. Can be used to
|
||||
override just the loader and keeping the rest unchanged.
|
||||
|
||||
.. versionadded:: 0.7
|
||||
"""
|
||||
return _DispatchingJinjaLoader(self)
|
||||
|
||||
def init_jinja_globals(self):
|
||||
"""Called directly after the environment was created to inject
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue