oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

What Is TurboGears (Hint: Python-Based Framework for Rapid Web Development)

by Matthew Russell
TurboGears is a Python-based framework that enables you to quickly build database-driven, ready-to-extend web applications. TurboGears can be developed on Windows, Linux, and Mac OS X. It allows you to seamlessly provide HTML or an API for JavaScript to work with, gives your designers room to work with any XHTML tool for building layouts, and enables you to use your database without writing SQL. TurboGears is free and released under liberal open source licenses for both non-commercial and commercial projects.

In this article

  1. It's Kind of Like Rails -- But with Python
  2. Similarities with Rails
  3. A Quick Closer Look at the Stack
  4. An Interview with the Creator of TurboGears
  5. The TurboGears Are Spinning Fast

Rails sure has stirred up a lot of buzz lately (and rightly so), but now there's another great way to develop your next web app. It's lean, it's mean, it's easy to configure and use, and it shouldn't be a surprise that it's based on Python, a language that truly makes the common cases fast and easy. Meet TurboGears -- the powerful new mega-framework that's designed specifically to help you create your next great web app as quickly as possible. And the best part is that you're going to have a lot of fun doing it.

It's Kind of Like Rails -- But with Python

TurboGears stack The TurboGears stack. Image courtesy of Blazing Things.

TurboGears puts together some of the best Pythonic frameworks available to bring you a mega-framework similar to Rails that makes it easy to get a lot of work done in very little time. It's a "full-stack" approach that covers the entire gamut of details involved with traditional web applications. Everything from slapping data down on the disk with SQLObject all the way up to providing a slick AJAX-based user experience with the help of MochiKit, the best JavaScript library you're going to find out there, is included in the package.

Sandwiched in between is CherryPy, the web application framework that makes cranking out dynamic content as easy as writing Python, and Kid, a powerful XML-based templating system. Each piece of the stack does what it does extremely well, and the overall effect of combining the pieces together certainly seems to produce an effect that's greater than the sum of the individual parts. Oh, and by the way, all of those projects are released under liberal open source licenses, as is TurboGears itself. Sound too good to be true? Let's take a closer look.

Similarities with Rails

Perhaps the most important similarity to Rails is the ultra-productivity that you can experience with TurboGears. Do you know of many other frameworks you can use to create a Wiki in only 20 minutes? (Didn't think so.) As we'll see, this productivity isn't the result of rocket science or some kind of profound inner truth. Rather, it's just the natural effect of combining nicely designed software components in a solid model-view-controller architecture.

Notably, each piece of the stack is based on Python, a powerful yet easy-to-use language that heralds itself as making development as simple and quick as possible. Python and Ruby are obviously different languages, but they share a lot of similarities with regard to the perks that they bring to the development cycle. Google's director of search quality, Peter Norvig, recently said, "Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we're looking for more people with skills in this language." Those are inspiring words to hear from a company that obviously has been doing something right.

Another similarity between TurboGears and Rails is that it takes the same basic model-view-controller approach to web development that separates your underlying data and logic from the actual presentation of your content. Not only is code that's written in this way naturally modular, it's also fairly easy to troubleshoot and maintain -- significant factors to consider regarding the life cycle of any project. The model-view-controller approach is the same great methodology that just about any mildly complex application for your Mac is designed with. Examples might not prove anything, but it's hard not to notice how successful Apple has been in leveraging this approach to dish out some pretty amazing applications these last few years.

Pages: 1, 2, 3, 4

Next Pagearrow