作者:ubunoon <> == 题目要求 == CSS文件的引用,在模板中引入default.css == 框架说明 == Pylons (http://pylonshq.com) == 步骤 == 在命令行下操作 === 1.创建Project4项目 === {{{ paster create -t pylons project4 }}} === 2.创建Hello App === {{{ cd project4 paster controller hello }}} === 3.修改project4/controllers/hello.py === {{{ #!python def index(self): return render('/index.html') }}} === 4.在project4/templates下创建index.html === {{{ Hello World

CSS Test

}}} === 5.生成 default.css === 创建project4/public/css/default.css文件,内容为: {{{ h1 {border:1px solid #f00;} }}} === 6.结束 === == 测试 == {{{ cd project4 paster serve --reload development.ini }}} 访问 http://localhost:5000/hello/index 结果如下: {{attachment:image.jpg}} == 说明 == pylons直接在public中寻找静态文件