You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/scenarios/web.rst
+124Lines changed: 124 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,15 @@ application that is not commonly found in other web frameworks.
90
90
Support can be found on its `mailing list <http://werkzeug.pocoo.org/community/#mailinglist>`_.
91
91
92
92
93
+
Tornado
94
+
--------
95
+
`Tornado <http://http://www.tornadoweb.org/>`_ is a scalable, non-blocking web server and web application framework with
96
+
a relative simple usage. Tornado is known for his high performance.
97
+
It was initially developed for `friendfeed <http://friendfeed.com/>`_ , a real time chat and blog system.
98
+
99
+
In the Jinja2 template engine example it is used to serve the rendered pages.
100
+
101
+
93
102
Pyramid
94
103
--------
95
104
@@ -269,6 +278,121 @@ and to the templates themselves.
269
278
the parts where the HTML template passes some variable content
270
279
to the javascript code.
271
280
281
+
282
+
283
+
Jinja2
284
+
------
285
+
`Jinja2 <http://jinja.pocoo.org/>`_ is a template engine which is similar to the Django template system with some extra features. It is a text-based template
286
+
language and thus can be used to generate any markup. It allows customization of filters, tags, tests and globals.
287
+
Unlike the template system implemented in the Django Framework it allows to call functions. The Code is staying under the BSD license.
288
+
289
+
Here some important html tags in Jinja2:
290
+
291
+
.. code-block:: html
292
+
293
+
{# This is a comment #}
294
+
295
+
{# The next tag is a variable output: #}
296
+
{{title}}
297
+
298
+
{# Tag for a block, can be replaced through inheritance with other html code #}
299
+
{% block head %}
300
+
<h1>This is the head!</h1>
301
+
{% endblock %}
302
+
303
+
{# Output of an array as an iteration #}
304
+
{% for item in list %}
305
+
<li>{{ item }}</li>
306
+
{% endfor %}
307
+
308
+
309
+
310
+
The next listings is an example of a web site in combination with the tornado web server. Tornado is not very complicate
0 commit comments