Mako tool for cherrypy
Project description
CherrypyMako is a cherrypy plugin that provides Mako template engine , within cherrypy as a tool.
Example:
demo.py:
import os.path import cherrypy import CherrypyMako import datetime CherrypyMako.setup() root_dir = os.path.abspath( os.path.dirname(__file__)) class Root(object): @cherrypy.expose @cherrypy.tools.mako(filename='index.html') def index(self): return {'currentTime':datetime.datetime.now()} _cp_config={ 'global':{ 'server.socket_host' : '0.0.0.0', 'server.socket_port' : 1919, 'tools.mako.directories' : [os.path.join(root_dir,'templates')], }, } if __name__ == '__main__': cherrypy.quickstart(Root(), '', config=_cp_config)
index.html:
<html> <head> <title>Cherrypy Mako Tool Demo</title> </head> <body> ${currentTime} </body> </html>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
CherrypyMako-0.3.1.tar.gz
(2.6 kB
view details)
Built Distribution
CherrypyMako-0.3.1-py2.7.egg
(4.1 kB
view details)
File details
Details for the file CherrypyMako-0.3.1.tar.gz
.
File metadata
- Download URL: CherrypyMako-0.3.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 433bb9ff2558fe36bc4a51adeb739e6d6c2a61a86ec1d81fcd47e29928e88f2e |
|
MD5 | 27213b0d6a1801840b42b2ac9d2ef080 |
|
BLAKE2b-256 | 604da80f62ccd0b389c97792fadce6220a5810bd9ed15cde986275958fa7ff1e |
File details
Details for the file CherrypyMako-0.3.1-py2.7.egg
.
File metadata
- Download URL: CherrypyMako-0.3.1-py2.7.egg
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ede396b8233c739d3dd455a9cf7d7a352e7e4cd517b8bd46fc3dc99813277a72 |
|
MD5 | 991d81747cfd55f7b19080da3d867c72 |
|
BLAKE2b-256 | b2da2d169b4006d6323c452f10427f805f0bb93c427cc64147a0880c291be054 |