Skip to main content

CherryPy tool to render output through Jinja2 templates

Project description

CherryPy-Jinja2

CherryPy-Jinja2 is a simple CherryPy Tool to render output via Jinja2 templates.

Import cherrypy_jinja2 to make the tool available in CherryPy's default toolbox.

Set tools.jinja2.search_path to a directory containing Jinja2 template files, then attach the tool to exposed methods:

class Root:
    @cherrypy.expose
    @cherrypy.tools.jinja2(template="index.html")
    def index(self):
        return {'message': "Hello"}

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

cherrypy-jinja2-2.2.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

cherrypy_jinja2-2.2-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

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