示例#1
0
class Jinja2Render():

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

    def render(self, context):
        return self.template.render(context)
示例#2
0
 def __init__(self, template_location):
     self.template = Template(tostring(template_location))
示例#3
0
文件: Welcome.py 项目: JW-Jp/Mysite
def main():
    user = {"name": 'Alice', "likes": 100}
    print(welcomeHtml(user))

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