The Turbogears Way

TurboGears 2 is a reinvention of TurboGears and a return to TurboGears’ roots.

TurboGears is a project that is built upon a foundation of library development, best-of-breed component selection, and the re-use of already existing code. And it was always intended to be a small collection of tools, docs, and helpers that made developing with that best-of-breed stack easy.

In retrospect, some of the code that was added to the main TurboGears project should have been released as independent projects that integrate with TurboGears. This would have allowed those pieces to grow independently of TurboGears, and would have allowed TurboGears to remain smaller and easier to develop and debug.

The TurboGears 0.5 release was just a few hundred lines of Python code, but it built on thousands of lines of code in other libraries. Those libraries had already been deployed, used, and tested, and were known to be “production ready.”

TurboGears2 returns to that philosophy. It is built on Pylons, but it brings a more full-stack approach to pylons. TurboGears 2 is committed to creating reusable components, and to achieving a long-term stable API based on the following Python components and libraries:

  • Models: SQLAlchemy
  • Template engines: Genshi, Mako and Jinja
  • URL Dispatching: Object dispatch
  • Form Handling: ToscaWidgets and Sprox
  • Authentication and Authorization: repoze.who & repoze.what

The zen of TurboGears is:

  • Make simple things easy and complex things possible.
  • It’s OK to be opinionated,
  • But it’s not OK to be obnoxious about those opinions.
  • Do your best to do things the right way,
  • But when there’s no “one right way,” don’t pretend there is.

Mark Ramm described the relationship between TurboGears and Pylons this way “TurboGears 2 is to Pylons as Ubuntu is to Debian.”

In other words we’re focused on user experience, and creating a novice-friendly environment. We ship a smaller subset of components, and thus are better able to focus, test, and document things so that new users have the best possible experience.

Meanwhile Pylons provides the power and flexibility of the underlying core.

And like Ubuntu, we don’t intend to hide that power and flexibility from advanced users, but we know that they want things set up to just work too.

Sensible defaults actually encourage code re-use within TurboGears because they make it possible for a group of TurboGears components to share assumptions about how things will work.