You should be able to customize TemplateLookup to get the desired behavior.
customlookup.py
from mako.lookup import TemplateLookup import haml class Lookup(TemplateLookup): def get_template(self, uri): if uri.rsplit('.')[1] == 'haml':
index.haml
<%inherit file="base.html"/> <%block name="content"> %h1 Hello </%block>
base.html
<html> <body> <%block name="content"/> </body> </html>
source share