Summary of Python Web Frameworks, Beginning of 2008
Let me summarize our recommendations for Python web frameworks:
- Pylons: for database-driven applications
- Plone (built on Zope3): for CMS (content management systems)
- Twisted: for multiple/custom network protocols or extremely high volume
Overall, the Python web community is seeing a lot of active development and evolution in solutions. Whereas the Ruby community has one go-to web framework (Ruby on Rails), the Python community has a plethora of choices. Luckily, a Python standard was created, PEP 333 aka WSGI (pronounced “whiskey” but stands for Web Server Gateway Interface), which provides a standard component architecture for Python web servers. All of the above frameworks support this standard now. This interface standard allows plug-and-play middleware.
We recommend Pylons for database-driven application development because internally it is built on WSGI. If TurboGears 2.0 development proceeds as designed and it is written on top of Pylons, then we will recommend it. Here are the middleware components that we recommend using with Pylons, and the features of each that we really love:
Database ORM: SQLAlchemy
- well designed: provides nice object interface to SQL tables, but also let’s you get to underlying SQL if you want to
- really efficient: can load entire graph of objects in one SQL query - e.g., load item and line item details in one round-trip to the database
Templating: Mako
- fast: it’s the fastest of the Python templating engines
- simple: you use standard Python in your templates, instead of custom tag libraries
Request Dispatching: Routes
- flexible: regular expressions with intelligent name binding to map tidy-looking urls to your internal object hierarchy
Form handling: ToscaWidgets
- no repetition: you model your form elements using Python objects, and use this model both for display and validation
- flexible: you can either use the default or specify your own template for html generation
Every category of middleware above has competition, but these are our current recommendations. Even though Pylons is a relatively new project, it is built on more mature components that are on at least their second major version.
January 3rd, 2008 at 9:48 pm
I’d like to recommend Orbited (www.orbited.org) as the python choice for Comet in web applications.
January 4th, 2008 at 2:44 pm
I don’t have any experience with Orbited, but thanks for the pointer. It sounds similar to Divmod’s Athena (http://www.divmod.org/trac/wiki/DivmodNevow/Athena).
January 29th, 2008 at 12:53 am
sure, if the average user manages to get all of that installed and working together it is fantastic. Otherwise he/she can try www.web2py.com, all in one package and no installation required.
January 31st, 2008 at 11:13 am
I found installation of Pylons straightforward, just one easy_install command:
easy_install ToscaWidgets twForms Pylons==0.9.6.1 SQLAlchemy