Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

No project description provided

Project description

Muffin-Jinja2 – Jinja2 template engine for Muffin framework.

Build Status Donate


  • python >= 3.3


Muffin-Jinja2 should be installed using pip:

pip install muffin-jinja2


Add muffin_jinja2 to PLUGINS in your Muffin Application configuration.


JINJA2_AUTO_RELOAD – Auto reload changed templates (False)

JINJA2_CACHE_SIZE – Cache templates (50)

JINJA2_EXTENSIONS – Enable Jinja2 Extensions (None)

JINJA2_LOADER – Template loader (FileSystemLoader)

JINJA2_ENCODING – Default encoding for file loader

JINJA2_TEMPLATE_FOLDERS – List of template folders ([‘templates’])


# Register custom context processor
# could be a function/coroutine
def custom_context():
    return { 'VAR': 'VALUE' }

# Register a function into global context
def sum(a, b):
    return a + b

# Register a function with a different name'div')
def mod(a, b):
    return a // b

# Register a filter
def test(value, a, b=None):
    return a if value else b

# Register a filter with a different name'bool')
def boolean(value):
    return bool(value)

def index(request):
    """ Check for user is admin. """
    local_context = {'key': 'value'}
    return'index.html', **local_context)

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at


Development of Muffin-Jinja2 happens at:


  • klen (Kirill Klenov)


Licensed under a MIT license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for muffin-jinja2, version 0.2.7
Filename, size File type Python version Upload date Hashes
Filename, size muffin_jinja2-0.2.7-py2.py3-none-any.whl (5.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size muffin-jinja2-0.2.7.tar.gz (5.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page