Skip to main content

jinja2 Engine for tornado web framework

Project description

This package makes you have the ability that using Jiaja2 Template Engine with Tornado Web Framework. It will replace the default Tornado Templates.

How to use:

Import Jinja2Loader to your project

from tornado_jinja2 import Jinja2Loader

Pass the instance of Jinja2Loader to tornado.web.Application as the value of “template_loader” parameter. You can use the particular Loader from jinja2 and configuring jinaja2 environment by your self.

import tornado.web
import jinja2

# Create a instance of Jinja2Loader
jinja2_env = jinja2.Environment(loader=jinja2.FileSystemLoader('template/path/'), autoescape=False)
jinja2_loader = Jinja2Loader(jinja2_env)

# Give it to Tornado to replace the default Loader.
settings = dict(template_loader=jinja2_loader)
application = tornado.web.Application(handler=[],
                                      **settings)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tornado_jinja2-0.2.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tornado_jinja2-0.2.4-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file tornado_jinja2-0.2.4.tar.gz.

File metadata

File hashes

Hashes for tornado_jinja2-0.2.4.tar.gz
Algorithm Hash digest
SHA256 eb0ac749f4353b3ea99af36c7cc7629de05ab5fa3d6fdd9ab4e10d8c433bf4f0
MD5 b29ba402ed361a9425d1a6a014ecff45
BLAKE2b-256 36bef93459eb02120239446bbceecf92d1c39bed2c43e6b0df00736fffa6d767

See more details on using hashes here.

File details

Details for the file tornado_jinja2-0.2.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tornado_jinja2-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a36d3ea8185e7e3f284501f5b2d531fc342b4f480ac8170ee32668934a3f7821
MD5 f9cab082cb334c8db35631beecc6e867
BLAKE2b-256 e30b3758c01bdae3ae1e97c1f6302a725e4c72c9b6277ef84ba8ded9a5e70be3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page