开发者

How do I add Jinja2 to my cherrypy project?

开发者 https://www.devze.com 2023-04-13 02:13 出处:网络
I have this tool right here http://tools.cherrypy.org/wiki/Jinja but wha开发者_StackOverflow社区t do I do with this?This tool allows you to render your response using jinga templates. Read the usage

I have this tool right here

http://tools.cherrypy.org/wiki/Jinja

but wha开发者_StackOverflow社区t do I do with this?


This tool allows you to render your response using jinga templates. Read the usage...

@cherrypy.expose
@cherrypy.tools.jinja(filename='index.html')
def controller(**kwargs):
    return {

    } # This dict is the template context     
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号