== 题目要求 == 写一个Hello,template程序,使用模板来显示Hello,{name},其中name是变量,要由外部传入 == 框架说明 == Pylons (http://pylonshq.com) == 步骤 == 在命令行下操作 === 1. 创建Project2项目 === {{{ paster create -t pylons project2 }}} === 2. 创建Hello App === {{{ cd project2 paster controller hello }}} === 3. 修改project2/controllers/hello.py === {{{ #!python def index(self): c.name = 'template' return render('/index.html') }}} === 4. 在project2/templates下创建index.html === {{{ Hello World

Hello, ${c.name}

}}} === 5. 结束 === == 测试 == {{{ cd project2 paster serve --reload development.ini }}} 访问 http://localhost:5000/hello/index 即可。