Skip to content
Flask bridge for Mako
Find file
Failed to load latest commit information.
flaskext removed app = app; thanks romme Jan 3, 2012 added the extension code - tests on the way Mar 3, 2011

Flask Mako

Provides Mako support in Flask.

Installation install


app.cfg (or however you configure your app)

# one or more directories
MAKO_DIR = 'sourcery/templates'
# optional, if specified Mako will cache to this directory
MAKO_CACHEDIR = '/tmp/mako'
# optional, if specified Mako will respect the cache size
MAKO_CACHESIZE = 500 (or wherever you create your app)

def create_app(name, **kw):
    from flask import Flask, g
    from flaskext.mako import init_mako

    app = Flask(name)

from flaskext.mako import render_template

app = Module(__name__)

def index():
    return render_template('test.html', username='Anonymous')
Something went wrong with that request. Please try again.