tipfy.ext.mako¶
This module provides functions to render templates using the Mako template engine.
See the extension wiki page.
Default configuration¶
- tipfy.ext.mako.default_config¶
Default configuration values for this module. Keys are:
- templates_dir: Directory for templates. Default is templates.
- engine_factory: A function to be called when the template engine is instantiated, as a string. If None, uses create_mako_instance().
Functions¶
- tipfy.ext.mako.render_template(filename, **context)¶
Renders a template.
Parameters: - filename – The template filename, related to the templates directory.
- context – Keyword arguments used as variables in the rendered template.
Returns: A rendered template, in unicode.
- tipfy.ext.mako.render_response(filename, **context)¶
Renders a template and returns a response object.
Parameters: - filename – The template filename, related to the templates directory.
- context – Keyword arguments used as variables in the rendered template.
Returns: A tipfy.Response object with the rendered template.
