Mako Templating Library

1.3.10 · active · verified Sat Mar 28

Mako is a hyperfast and lightweight templating language for Python, designed to be both powerful and easy to use. The current version is 1.3.10, released on March 28, 2026. Mako follows a regular release cadence, with updates addressing bugs and improvements.

Warnings

Install

Imports

Quickstart

This example demonstrates how to set up a template lookup, load a template, and render it with variables using Mako.

from mako.template import Template
from mako.lookup import TemplateLookup

# Set up template lookup
mylookup = TemplateLookup(directories=['/path/to/templates'])

# Load a template
mytemplate = mylookup.get_template('mytemplate.html')

# Render the template with variables
output = mytemplate.render(variable1='value1', variable2='value2')

print(output)

view raw JSON →