When comparing Klein vs TurboGears 2, the Slant community recommends TurboGears 2 for most people. In the question“What are the best general-purpose Python web frameworks usable in production sites?” TurboGears 2 is ranked 11th while Klein is ranked 20th. The most important reason people chose TurboGears 2 is:
SQLAlchemy is a powerful ORM which is highly regarded in the Python community. TurboGears' ORM is built with SQLAlchemy, which gives it a great deal of flexibility and power.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro More concurrent requests, more interactivity
The fact that a Klein server is event-driven and non-blocking means that it can start handling a new request while previous requests are still open. This lets you serve more requests from a single process, meaning running multiple servers is now an option to be explored when your site makes it big, rather than a necessity for responsiveness under even modest loads.
Multiple requests per process also gives you flexibility to do things that would be impractical in WSGI-based alternatives like Flask or Bottle, such as keeping a connection to the browser open to send it chat messages or game updates in a Server Sent Event stream.
Pro A powerful and flexible Object Relational Mapper (ORM) with real multi-database support
SQLAlchemy is a powerful ORM which is highly regarded in the Python community. TurboGears' ORM is built with SQLAlchemy, which gives it a great deal of flexibility and power.
Pro Code that is as natural as writing a function
Pro Starts as a microframework and scales up to a fullstack solution
Allows developers to build quick, simple web prototypes or scale up to create complex web applications.
Pro Support for Horizontal data partitioning (aka, sharding)
TurboGears allows for horizontal data partitioning, which allows the division of logical datatabases into smaller elements.
Pro Built in extensibility Pluggable Applications and standard WSGI components
Allows for creating extendable Pluggable Applications which extend the framework itself through endpoints provided by TurboGears.
Pro Validated and compile time checked template engine
The template engine is XHTML based and so is validated for errors when compiled to HTML. You will never serve a broken page again due to a forgotten close tag
Pro Aims for a flexible design
TurboGears2 does not get in your way on how to design your applications, classes etc.
Cons
Con Lacks database integration
Talking to database is a pretty common thing for a web application to do. Larger frameworks know this, and cover it in some detail by the end of the tutorial. In contrast, the Klein documentation is currently silent on this topic, leaving the issue of how to do database queries in a way that won't block your event-driven code entirely up to you.
Con The great extensibility can feel overwhelming
Sometimes TurboGears' extensibility and feeling of having different options for doing a single thing can feel overwhelming and as if writing everything from scratch.