Example #1
0
class Jinja2Render():

    def __init__(self, template_location):
        self.template = Template(tostring(template_location))

    def render(self, context):
        return self.template.render(context)
Example #2
0
 def __init__(self, template_location):
     self.template = Template(tostring(template_location))
Example #3
0
def main():
    user = {"name": 'Alice', "likes": 100}
    print(welcomeHtml(user))

    tmpl = Template(welcomeHtml())
    print(tmpl.render(user))