TurboGears 学习笔记-安装

Zope3 很强大,但是一直徘徊在 python 2.4 不升级。学习的兴趣骤减。Django 版本一直停滞在 0.96 不前。据说 12 月会出 1.0,但是兼容性似乎不能保障。偶然的机会看到一篇 TurboGears 的文章,似乎停简单。于是乎,先学安装。

TurboGears 的安装已经简单到了及至:easy_install turbogears。

在 ubuntu 下使用 easy_install 这个命令需要安装 python-setuptools 这个包。

在终端中执行 tg-admin 这个命令,一切正常,除了会有一个警告:UserWarning: Your installation of Python doesn’t have a profile module.原来还需要安装 python-profiler 这个包,使用 apt-get 安装之后,这个警告就不会再出现了。

使用 tg-admin quickstart 生成一个项目,比如 sandbox。进入自动生成的 sandbox 目录,执行命令 ./start-sandbox.py 一切 OK,只要 8080 端口没有被占用,TurboGears 就正常启动了。

在开发模式下,如果需要修改 8080 端口,找到 dev.cfg 文件中的 #server.socket_port=8080 行,去掉注释,修改端口,重新执行 ./start-sandbox.py 即可。

TurboGears 所具有的美感是 zend framework 所不具备的。连安装和部署都这么简单。希望 zend framework 能够取其之长,至少提供几个实用的自动化工具也好啊。

Join the Conversation

2 Comments

  1. django 1.0出了~

    要说美感的话,web.py 也有一种惊艳的简洁~可惜才0.3……

Leave a comment

Your email address will not be published. Required fields are marked *