Philosophy: a Megaframework at 1.0

When you use Django, you are using the Django templating system with the Django database mapper with the Django URL/controller framework. TurboGears (http://www.turbogears.com) takes the opposite approach, unifying mature projects into a "mega-framework." Central to the mega-framework approach is the idea that, while core packages should be supported out-of-the-box, it should be easy to plug in or replace most of the layers.

Powered by CherryPy

The single un-replaceable subproject in TurboGears is CherryPy (http://cherrypy.org), the multithreaded web server written entirely in Python. It is less analogous to a pure HTTP server such as Apache and is more of a runtime container, as Tomcat is for Java. CherryPy provides mechanisms for responding to requests, attaching methods to serve those requests, and establishing session, request, and response objects. TurboGears is essentially an extension of CherryPy.

Unlike the Django development server or WEBrick in Rails, CherryPy is a production-level server. CherryPy can be mounted behind Apache or IIS for deployment purposes but CherryPy will handle the actual work of servicing user requests in a TurboGears project. It supports all the standard HTTP server functions, including serving static assets (such as images), file upload, exception handling, and logging.

Having a production-quality server embedded in the framework is a huge win at launch time, as any developer who has struggled to migrate ...

Get Next-Generation Web Frameworks in Python now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.