2012年3月8日星期四

pylons学习(续)

学习Pylons的示例,最好用英文目录下测试,中文目录下很多编码问题,
目前还没找到好的办法解决中文目录造成的模板显示问题。

1,response ,request用法
2,Pylons提供了多种调试问题的方式,
网页调试
3,mako  Template技术
各种技术都大体类似
Mako语法的注释
<%doc></%doc>
##
输出文本语法
<%text></%text>
%  后面可以跟可执行的python命名
<%    %>中间是代码段
<%!     %>   module级的代码块,里面的内容只被执行一次


Mako模板调试
wingware提供了一种方式,蛮好用的,分享一下
To avoid this, do not specify the --reload flag for Paste. Place the following in a file that you add to your project and set as the main debug file:

from paste.script.serve import ServeCommand
ServeCommand("serve").run(["development.ini"])

This may vary somewhat, as necessary for your application.

http://wingware.com/doc/howtos/paste-pylons

没有评论: