Pillars of Python: Six Python Web frameworks compared

CubicWeb, Django, Pyramid, Web.py, Web2py, and Zope 2 give Python-savvy Web application developers powerful and diverse options

1 2 3 Page 3
Page 3 of 3

Python Web frameworks: Min or max?
If you prefer a framework that puts the minimum between you and the Web, then Web.py will be your best choice. On the other hand, if you like wizards guiding you along the way, then you may prefer Web2py. CubicWeb is an excellent choice if your data comes from disparate sources. If your website's structure is data driven, then have a look at Pyramid or Zope 2. In addition, Zope 2 and Django are solid all-around choices, both having stood the test of time.

But these are only general suggestions. It's not the case that any particular Python Web framework is at a significant disadvantage to the others. As usual, the choice is highly subjective. You will find zealots for each product, and every zealot is able to present rational reasons why their chosen framework is superior.

Naturally, the current discussion paints only an overview. For the finer details, follow the links in the table below and plunge into the individual reviews.

Python Web frameworks compared

 Python versionsLicensingDocumentationWeb servers
CubicWeb 3.12.5Any 2.x Python back to 2.5LGPLTutorials, online user guide, and administration guide, all available from the main Web pageTwisted Web server, usually run with Apache. WSGI support is in the works.
Django 1.3Any 2.x Python versionBSDTutorial, reference guide, and how-to guides, arranged like an online bookAny Web server that supports WSGI or FastCGI
Pyramid 1.0Python 2.4 through 2.7BSD-likeUser guide, tutorials, sample applications, and API referenceAny Web server that supports WSGI. Also includes its own Web server suitable for large-scale applications.
Web.py 0.35Any 2.x Python back to 2.3No restrictions, but includes the CherryPy Web server governed by the CherryPy licenseCookbook, API reference, and categorized code examplesAny Web server supporting CGI, FastCGI, SCGI, or WSGI
Web2py 1.95Python 2.5 through 2.7LGPLOnline book, example website, lots of online "quick examples"Any Web server that supports Python
Zope 2.13Depends on Zope 2 version, varying from Python 2.4 for Zope 2.11.x to Python 2.7 for Zope 2.13.xZope Public LicenseOnline book includes API reference, management interface guide, templates reference, and moreAny Web server that supports Python. Also includes its own Web server suitable for production use.

Python Web frameworks compared, continued

 Database supportCachingDebuggingLogging JavaScript support
CubicWeb 3.12.5MySQL, PostgreSQL, SQLite, Microsoft SQL ServerPlannedDebug mode will display log messages on a console, show trace information, show generated SQL queries, and moreYes Yes, based on JQuery
Django 1.3MySQL, PostgreSQL, SQLite, Oracle; third-party support for other databasesYes, both at the model and view levelsYes; both in its development Web server and a special debug execution modeUses standard Python logging; latest version added configuration hooks None specific, though third-party libraries for integrating JavaScript libraries are available
Pyramid 1.0Any Python ORM tool such as SQLAlchemy, MongoDB, and CassandraYes, via the Python Beaker package; provides page-level database query and other cachingYes; interactive debugger that runs in the browser provides detailed stack traceYes, via standard Python logging package No, though Pyramid does provide convenience functions for JSON and Ajax
Web.py 0.35MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle, FirebirdSome support for caching templatesYes; debug mode will automatically load code changes and provide detailed error pagesNo, but you can incorporate the Python logging system Yes, via jsdef (used in the template language)
Web2py 1.95MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle, IBM DB2, Informix, Ingres, Firebird, Google App EngineYes; caching is integrated with database queriesNo, but logging system tickets any uncaught exceptionsYes, using the standard Python logging module; every app writes to its own log Yes, custom JavaScript atop JQuery is used in various places
Zope 2.13Zope Object Database (ZODB) and third-party ZODB emulators such as RelStorageYes; includes several built-in caching helpersYes; debug mode lets you run Zope while watching debugging and logging outputYes; uses standard Python logging capability None specific

This article, "Pillars of Python: Six Python Web frameworks compared," was originally published at InfoWorld.com. Follow the latest developments in application development and Python at InfoWorld.com. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Copyright © 2011 IDG Communications, Inc.

1 2 3 Page 3
Page 3 of 3
InfoWorld Technology of the Year Awards 2023. Now open for entries!