parent
66b4ea91b4
commit
d13a1b363e
2 changed files with 3 additions and 3 deletions
|
|
@ -160,7 +160,7 @@ class Flask(_PackageBoundObject):
|
|||
#: The class that is used for the Jinja environment.
|
||||
#:
|
||||
#: .. versionadded:: 1.0
|
||||
jinja_env_class = Environment
|
||||
jinja_environment = Environment
|
||||
|
||||
#: The class that is used for the :data:`~flask.g` instance.
|
||||
#:
|
||||
|
|
@ -685,7 +685,7 @@ class Flask(_PackageBoundObject):
|
|||
options['auto_reload'] = self.config['TEMPLATES_AUTO_RELOAD']
|
||||
else:
|
||||
options['auto_reload'] = self.debug
|
||||
rv = self.jinja_env_class(self, **options)
|
||||
rv = self.jinja_environment(self, **options)
|
||||
rv.globals.update(
|
||||
url_for=url_for,
|
||||
get_flashed_messages=get_flashed_messages,
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ def test_custom_jinja_env():
|
|||
pass
|
||||
|
||||
class CustomFlask(flask.Flask):
|
||||
jinja_env_class = CustomEnvironment
|
||||
jinja_environment = CustomEnvironment
|
||||
|
||||
app = CustomFlask(__name__)
|
||||
assert isinstance(app.jinja_env, CustomEnvironment)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue