Skip to content

Commit d8259eb

Browse files
committed
use Jinja name consistently
1 parent 38b4c1e commit d8259eb

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

CHANGES.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ Released 2011-09-29, codename Rakija
13761376
of Flask itself and no longer of the test client. This cleaned up
13771377
some internal logic and lowers the odds of runaway request contexts
13781378
in unittests.
1379-
- Fixed the Jinja2 environment's ``list_templates`` method not
1379+
- Fixed the Jinja environment's ``list_templates`` method not
13801380
returning the correct names when blueprints or modules were
13811381
involved.
13821382

@@ -1462,7 +1462,7 @@ Released 2010-12-31
14621462

14631463
- Fixed an issue where the default ``OPTIONS`` response was not
14641464
exposing all valid methods in the ``Allow`` header.
1465-
- Jinja2 template loading syntax now allows "./" in front of a
1465+
- Jinja template loading syntax now allows "./" in front of a
14661466
template load path. Previously this caused issues with module
14671467
setups.
14681468
- Fixed an issue where the subdomain setting for modules was ignored

docs/design.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@ is ambiguous.
9696
One Template Engine
9797
-------------------
9898

99-
Flask decides on one template engine: Jinja2. Why doesn't Flask have a
99+
Flask decides on one template engine: Jinja. Why doesn't Flask have a
100100
pluggable template engine interface? You can obviously use a different
101-
template engine, but Flask will still configure Jinja2 for you. While
102-
that limitation that Jinja2 is *always* configured will probably go away,
101+
template engine, but Flask will still configure Jinja for you. While
102+
that limitation that Jinja is *always* configured will probably go away,
103103
the decision to bundle one template engine and use that will not.
104104

105105
Template engines are like programming languages and each of those engines
106106
has a certain understanding about how things work. On the surface they
107107
all work the same: you tell the engine to evaluate a template with a set
108108
of variables and take the return value as string.
109109

110-
But that's about where similarities end. Jinja2 for example has an
110+
But that's about where similarities end. Jinja for example has an
111111
extensive filter system, a certain way to do template inheritance,
112112
support for reusable blocks (macros) that can be used from inside
113113
templates and also from Python code, supports iterative template
@@ -118,8 +118,8 @@ other hand treats templates similar to Python modules.
118118

119119
When it comes to connecting a template engine with an application or
120120
framework there is more than just rendering templates. For instance,
121-
Flask uses Jinja2's extensive autoescaping support. Also it provides
122-
ways to access macros from Jinja2 templates.
121+
Flask uses Jinja's extensive autoescaping support. Also it provides
122+
ways to access macros from Jinja templates.
123123

124124
A template abstraction layer that would not take the unique features of
125125
the template engines away is a science on its own and a too large
@@ -150,7 +150,7 @@ authentication technologies, and more. Flask may be "micro", but it's ready for
150150
production use on a variety of needs.
151151

152152
Why does Flask call itself a microframework and yet it depends on two
153-
libraries (namely Werkzeug and Jinja2). Why shouldn't it? If we look
153+
libraries (namely Werkzeug and Jinja). Why shouldn't it? If we look
154154
over to the Ruby side of web development there we have a protocol very
155155
similar to WSGI. Just that it's called Rack there, but besides that it
156156
looks very much like a WSGI rendition for Ruby. But nearly all
@@ -208,7 +208,7 @@ What Flask is, What Flask is Not
208208

209209
Flask will never have a database layer. It will not have a form library
210210
or anything else in that direction. Flask itself just bridges to Werkzeug
211-
to implement a proper WSGI application and to Jinja2 to handle templating.
211+
to implement a proper WSGI application and to Jinja to handle templating.
212212
It also binds to a few common standard library packages such as logging.
213213
Everything else is up for extensions.
214214

docs/patterns/streaming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ debug environments with profilers and other things you might have enabled.
2929
Streaming from Templates
3030
------------------------
3131

32-
The Jinja2 template engine supports rendering a template piece by
32+
The Jinja template engine supports rendering a template piece by
3333
piece, returning an iterator of strings. Flask provides the
3434
:func:`~flask.stream_template` and :func:`~flask.stream_template_string`
3535
functions to make this easier to use.

docs/patterns/wtforms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ WTForm's field function, which renders the field for us. The keyword
9999
arguments will be inserted as HTML attributes. So, for example, you can
100100
call ``render_field(form.username, class='username')`` to add a class to
101101
the input element. Note that WTForms returns standard Python strings,
102-
so we have to tell Jinja2 that this data is already HTML-escaped with
102+
so we have to tell Jinja that this data is already HTML-escaped with
103103
the ``|safe`` filter.
104104

105105
Here is the :file:`register.html` template for the function we used above, which

docs/quickstart.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ Rendering Templates
352352

353353
Generating HTML from within Python is not fun, and actually pretty
354354
cumbersome because you have to do the HTML escaping on your own to keep
355-
the application secure. Because of that Flask configures the `Jinja2
355+
the application secure. Because of that Flask configures the `Jinja
356356
<https://palletsprojects.com/p/jinja/>`_ template engine for you automatically.
357357

358358
Templates can be used to generate any type of text file. For web applications, you'll
@@ -392,8 +392,8 @@ package it's actually inside your package:
392392
/templates
393393
/hello.html
394394

395-
For templates you can use the full power of Jinja2 templates. Head over
396-
to the official `Jinja2 Template Documentation
395+
For templates you can use the full power of Jinja templates. Head over
396+
to the official `Jinja Template Documentation
397397
<https://jinja.palletsprojects.com/templates/>`_ for more information.
398398

399399
Here is an example template:

docs/templating.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Templates
22
=========
33

4-
Flask leverages Jinja2 as its template engine. You are obviously free to use
5-
a different template engine, but you still have to install Jinja2 to run
4+
Flask leverages Jinja as its template engine. You are obviously free to use
5+
a different template engine, but you still have to install Jinja to run
66
Flask itself. This requirement is necessary to enable rich extensions.
7-
An extension can depend on Jinja2 being present.
7+
An extension can depend on Jinja being present.
88

9-
This section only gives a very quick introduction into how Jinja2
9+
This section only gives a very quick introduction into how Jinja
1010
is integrated into Flask. If you want information on the template
11-
engine's syntax itself, head over to the official `Jinja2 Template
11+
engine's syntax itself, head over to the official `Jinja Template
1212
Documentation <https://jinja.palletsprojects.com/templates/>`_ for
1313
more information.
1414

1515
Jinja Setup
1616
-----------
1717

18-
Unless customized, Jinja2 is configured by Flask as follows:
18+
Unless customized, Jinja is configured by Flask as follows:
1919

2020
- autoescaping is enabled for all templates ending in ``.html``,
2121
``.htm``, ``.xml``, ``.xhtml``, as well as ``.svg`` when using
@@ -25,13 +25,13 @@ Unless customized, Jinja2 is configured by Flask as follows:
2525
- a template has the ability to opt in/out autoescaping with the
2626
``{% autoescape %}`` tag.
2727
- Flask inserts a couple of global functions and helpers into the
28-
Jinja2 context, additionally to the values that are present by
28+
Jinja context, additionally to the values that are present by
2929
default.
3030

3131
Standard Context
3232
----------------
3333

34-
The following global variables are available within Jinja2 templates
34+
The following global variables are available within Jinja templates
3535
by default:
3636

3737
.. data:: config
@@ -140,7 +140,7 @@ using in this block.
140140
Registering Filters
141141
-------------------
142142

143-
If you want to register your own filters in Jinja2 you have two ways to do
143+
If you want to register your own filters in Jinja you have two ways to do
144144
that. You can either put them by hand into the
145145
:attr:`~flask.Flask.jinja_env` of the application or use the
146146
:meth:`~flask.Flask.template_filter` decorator.
@@ -157,7 +157,7 @@ The two following examples work the same and both reverse an object::
157157

158158
In case of the decorator the argument is optional if you want to use the
159159
function name as name of the filter. Once registered, you can use the filter
160-
in your templates in the same way as Jinja2's builtin filters, for example if
160+
in your templates in the same way as Jinja's builtin filters, for example if
161161
you have a Python list in context called `mylist`::
162162

163163
{% for x in mylist | reverse %}
@@ -211,7 +211,7 @@ strings. This can be used for streaming HTML in chunks to speed up
211211
initial page load, or to save memory when rendering a very large
212212
template.
213213

214-
The Jinja2 template engine supports rendering a template piece
214+
The Jinja template engine supports rendering a template piece
215215
by piece, returning an iterator of strings. Flask provides the
216216
:func:`~flask.stream_template` and :func:`~flask.stream_template_string`
217217
functions to make this easier to use.

docs/web-security.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ tags. For more information on that have a look at the Wikipedia article
5151
on `Cross-Site Scripting
5252
<https://en.wikipedia.org/wiki/Cross-site_scripting>`_.
5353

54-
Flask configures Jinja2 to automatically escape all values unless
54+
Flask configures Jinja to automatically escape all values unless
5555
explicitly told otherwise. This should rule out all XSS problems caused
5656
in templates, but there are still other places where you have to be
5757
careful:
5858

59-
- generating HTML without the help of Jinja2
59+
- generating HTML without the help of Jinja
6060
- calling :class:`~markupsafe.Markup` on data submitted by users
6161
- sending out HTML from uploaded files, never do that, use the
6262
``Content-Disposition: attachment`` header to prevent that problem.
@@ -65,7 +65,7 @@ careful:
6565
trick a browser to execute HTML.
6666

6767
Another thing that is very important are unquoted attributes. While
68-
Jinja2 can protect you from XSS issues by escaping HTML, there is one
68+
Jinja can protect you from XSS issues by escaping HTML, there is one
6969
thing it cannot protect you from: XSS by attribute injection. To counter
7070
this possible attack vector, be sure to always quote your attributes with
7171
either double or single quotes when using Jinja expressions in them:

src/flask/sansio/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def auto_find_instance_path(self) -> str:
521521
return os.path.join(prefix, "var", f"{self.name}-instance")
522522

523523
def create_global_jinja_loader(self) -> DispatchingJinjaLoader:
524-
"""Creates the loader for the Jinja2 environment. Can be used to
524+
"""Creates the loader for the Jinja environment. Can be used to
525525
override just the loader and keeping the rest unchanged. It's
526526
discouraged to override this function. Instead one should override
527527
the :meth:`jinja_loader` function instead.

src/flask/templating.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _default_template_ctx_processor() -> dict[str, t.Any]:
3737

3838

3939
class Environment(BaseEnvironment):
40-
"""Works like a regular Jinja2 environment but has some additional
40+
"""Works like a regular Jinja environment but has some additional
4141
knowledge of how Flask's blueprint works so that it can prepend the
4242
name of the blueprint to referenced templates if necessary.
4343
"""

0 commit comments

Comments
 (0)