DAOCLOUD
推荐学习书目
› Python Cookbook
› Using Google App Engine
推荐下载
› Latest Google App Engine SDK
其他兼容技术
› AppScale
bbs

gae中模板可以直接渲染而不需要载入静态文件吗?

  •  
  •   bbs · Mar 7, 2011 · 5899 views
    This topic created in 5729 days ago, the information mentioned may be changed or developed.
    我想直接在程序中渲染。
    7 replies  •  1970-01-01 08:00:00 +08:00
    shanghaikid
    shanghaikid
    Mar 7, 2011
    1
    那就不叫模板了吧,直接response.out.write?
    bbs
    bbs
    OP
    Mar 7, 2011
    2
    @shanghaikid 我的意思是想使用模板的渲染功能,比如转义字符 格式化时间等等
    zhouyang
    zhouyang
    Mar 7, 2011
    3
    django的filter?
    bbs
    bbs
    OP
    Mar 7, 2011
    4
    现在不是要obj=self.render('x.html',{})

    如何能不需要引入x.html 直接得到渲染的内容
    darasion
    darasion
    Mar 7, 2011
    5
    楼主指的是用 string.Template ?
    bbs
    bbs
    OP
    Mar 7, 2011
    6
    @darasion
    我其实是想直接要模板的渲染功能,不需要输出到模板页,我现在找到了 timesince

    from django.utils.timesince import timesince

    但没找到escape,用 re.escape 转义字符 可有正则转义的反斜杠,不带杠的escape有哪个?
    bbs
    bbs
    OP
    Mar 7, 2011
    7
    找到了。。。谢谢各位
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   989 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:13 · PVG 06:13 · LAX 14:13 · JFK 17:13
    ♥ Do have faith in what you're doing.