class Jinja2Render(): def __init__(self, template_location): self.template = Template(tostring(template_location)) def render(self, context): return self.template.render(context)
def __init__(self, template_location): self.template = Template(tostring(template_location))
def main(): user = {"name": 'Alice', "likes": 100} print(welcomeHtml(user)) tmpl = Template(welcomeHtml()) print(tmpl.render(user))