New TurboGears Project
New TurboGears Project
Tue, 12/06/2005 - 06:22 — Derek AndersonI am working on yet another project which is using My Favourite Language®. This time, I am using the (rather new) TurboGears framework. TurboGears is an amalgamation of many different sub projects into a fairly lightweight web application foundation. They also provide an easy to follow tutorial which gives a pretty solid overview of the system. I highly recommend also going over the CherryPy documentation as well.
Following is a set of notes on the tutorial, and some help with fixing the errors I ran into.
While working through the tutorial, I ran into quite a few snafus which caused me grief. Most of them are related to the fact that TurboGears requires "bleeding edge" versions of all of it's subcomponents, and is intolerant of older versions being installed anywhere in the stack. In particular docutils and CherryPy gave me problems. Some of the errors I encountered were:
- keyerror on html_body during the third page (fixed as per a suggestion on page 2 by upgrading docutils). The default Gentoo docutils package is still a couple of versions behind, and caused breakage. I removed the package and ran the command
sudo easy_install docutils
sudo easy_install -f http://www.turbogears.org/download/index.html TurboGears
You will notice that I am not locking to /usr/local/bin for the binaries dir on the install. I actually manually removed all of the binaries as well before the install, since older versions of the tg-admin appear to generate deprecated code for the newer TurboGears libraries. Do an ls -alrt on both /usr/local/bin and /usr/bin to look for recently added TurboGears binaries so that you can remove them if you need to perform this step.
Another really interesting thing about TurboGears is the speed. I ran the server in both dev and production modes, with siege to make it cry like a little girl.
- First of all, performance in dev mode:
Lifting the server siege... done.
Transactions: 221 hits
Availability: 100.00 %
Elapsed time: 17.24 secs
Data transferred: 0.34 MB
Response time: 1.77 secs
Transaction rate: 12.82 trans/sec
Throughput: 0.02 MB/sec
Concurrency: 22.67
Successful transactions: 221
Failed transactions: 0
Longest transaction: 9.94
Shortest transaction: 0.00
- Then in "production" mode
Lifting the server siege... done.
Transactions: 988 hits
Availability: 100.00 %
Elapsed time: 40.32 secs
Data transferred: 1.45 MB
Response time: 3.23 secs
Transaction rate: 24.50 trans/sec
Throughput: 0.04 MB/sec
Concurrency: 79.24
Successful transactions: 988
Failed transactions: 0
Longest transaction: 9.98
Shortest transaction: 0.03
I realize that these are hardly serious benchmarks, but just as an indicator, they show that my measly 1.86Ghz laptop can server a pretty heavy page load on this wiki demo.


