V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
qiu0130
V2EX  ›  Python

Flask Mako 模版问题

  •  
  •   qiu0130 · May 28, 2016 · 3207 views
    This topic created in 3627 days ago, the information mentioned may be changed or developed.

    说有一个

    app.py

    def fun():

      xxxx

      return xxx

    home.html

    为什么不能使用${ fun() }

    3 replies    2016-05-30 00:24:33 +08:00
    jzp113
        1
    jzp113  
       May 28, 2016
    那还要 js 干嘛
    qiu0130
        2
    qiu0130  
    OP
       May 28, 2016
    @jzp113 js 处理后台数据?
    fohnwind
        3
    fohnwind  
       May 30, 2016   ❤️ 1
    mako 貌似是直接渲染内容吧,根据变量。如果要使用函数的话试试 jinja2 ?
    理解有限。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   955 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 18:15 · PVG 02:15 · LAX 11:15 · JFK 14:15
    ♥ Do have faith in what you're doing.