开发者

How do I add Jinja2 to my cherrypy project?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜