1. ollyc
  2. fresco-jinja2

Overview

HTTPS SSH

fresco-jinja2 - Jinja2 Templates for Fresco

Synopsis:

from fresco import FrescoApp
from fresco_jinja2 import Jinja2
from jinja2 import PackageLoader

app = FrescoApp()
jinja2 = Jinja2(app, loader=PackageLoader('mypackage', 'template/dir'))


@jinja2.contextprocessor
def default_context():
    # Return a dictionary of variables always to be included in the
    # template context.
    #
    # NB the fresco context object and urlfor function are already included
    # in the template context by default.
    return {}

@jinja2.render('page.html')
def myview():
    return {'var': 'value'}