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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cherrypy-jinja2-2.2.tar.gz.

File metadata

  • Download URL: cherrypy-jinja2-2.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.9

File hashes

Hashes for cherrypy-jinja2-2.2.tar.gz
Algorithm Hash digest
SHA256 333ca4170bdc094d0dc93a58ea61770bae9bcafbfd8db82bb36f32e1defc6b0b
MD5 b5adf3474e972984c44bd1b9b4623efb
BLAKE2b-256 9f76b1de0408ec5cae50598b2634a823cc75becfd4ff91f8bfd0bf9042d39b2e

See more details on using hashes here.

File details

Details for the file cherrypy_jinja2-2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cherrypy_jinja2-2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8adf8a189a39eed39a3e5a6fabdf512500971e370733e3ac90e377586ba51285
MD5 ff2409ec8adb429d546e7a5d534ea4c7
BLAKE2b-256 296e283bf3b2d47f2732d25cb81753a18592c0fdb2105aeeb3bd3a2653fb6482

See more details on using hashes here.

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