Skip to content

AnIrishDuck/flask-mako-legacy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

** NOTE: This codebase is now deprecated. I've decided to fork benselme's
   extension and update that in the interest of maintaining a common code base.
   See https://github.com/AnIrishDuck/flask-mako **


A simple extension that integrates Mako template rendering into Flask
applications. Usage::

    # Set the template directory. This can also be a list of directories.
    app.config['MAKO_TEMPLATE_DIR'] = 'templates/'
    # These parameters are optional.
    app.config['MAKO_CACHE_DIR'] = 'cache/'
    app.config['MAKO_CACHE_SIZE'] = 200
    mako = MakoTemplates(app)

    @app.route('/')
    def index(): return mako.render("index.tpl", message="hello")

The template rendering functionality is designed to be as similar to the
built-in Jinja2 behavior as possible. Thus, the same parameters (``url_for``,
``request``, ``context``, etc) will be set by default. Other features, such as
custom ``context_processor`` hooks and the ``template_rendered`` signal, will
also work.

For more in-depth examples see the ``tests/`` and ``examples/`` directories.

To run the bundled tests: ``python setup.py test``.

About

Mako templating with Flask.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages