Turbogears: a framework reborn (Mark Ramm)

Tags: europython2009, europython

Mark Ramm is the third maintainer (and the longest lasting one!) of Turbogears. With a couple of people they rewrote turbogears (with the same external API) on top of pylons.

Turbogears is a modern MVC platform. It is mostly cobbled together from various bits and pieces and libraries found on the Internet. Building a web framework from spare parts can be fun. It is no fun to write everything yourself: just use sqlalchemy for the database integration instead of writing your own, for instance.

Why would I learn Turbogears? Well, it is reusable learning. You have to learn sqlalchemy, which is useful in other projects and frameworks. Genshi templates, the same way. Most of they key elements of turbogears are useful elsewhere. That’s not always true of other tightly coupled web frameworks.

Turbogears 2.0 is better than 1.0 because there are so many good quality python libraries nowadays. For instance beaker for caching. And the whole WSGI middleware thing with handy tools like WebError.

When you make a whole framework yourself, it is hard to get the individual pieces right as it is hard to think about the interfaces between the pieces. If you re-use a template system instead, you make it inherently easy to switch to other template systems.

Mark plugs sqlalchemy as being the best ORM (object relational mapper) in any language.

A lot of new web frameworks don’t work that well scalability-wise. Many design decisions don’t work that well. Too small sql queries and so. Mostly because of something called the active record pattern. There’s a one-on-one mapping between objects and database tables. With the help of sqlalchemy, turbogears 2.0 uses a better mechanism: eager, lazy and dynamic object graphs. The data mapper pattern. Sourceforge is going to use/is already using turbogears for most of their pages!

Turbogears is an industrial strength web framework that can handle huge deployments. But it is also still easy to get started with for small tasks. “You should be able to easily create a form today and scale tomorrow”.

Birmingham at night
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):