|
|
|
@ -347,7 +347,7 @@ Rendering Templates
|
|
|
|
|
Generating HTML from within Python is not fun, and actually pretty |
|
|
|
|
cumbersome because you have to do the HTML escaping on your own to keep |
|
|
|
|
the application secure. Because of that Flask configures the `Jinja2 |
|
|
|
|
<http://jinja.pocoo.org/2/>`_ template engine for you automatically. |
|
|
|
|
<http://jinja.pocoo.org/>`_ template engine for you automatically. |
|
|
|
|
|
|
|
|
|
To render a template you can use the :func:`~flask.render_template` |
|
|
|
|
method. All you have to do is provide the name of the template and the |
|
|
|
@ -380,7 +380,7 @@ package it's actually inside your package:
|
|
|
|
|
|
|
|
|
|
For templates you can use the full power of Jinja2 templates. Head over |
|
|
|
|
to the official `Jinja2 Template Documentation |
|
|
|
|
<http://jinja.pocoo.org/2/documentation/templates>`_ for more information. |
|
|
|
|
<http://jinja.pocoo.org/docs/templates>`_ for more information. |
|
|
|
|
|
|
|
|
|
Here is an example template: |
|
|
|
|
|
|
|
|
|