[ Team LiB ] |
29.7 Web Application FrameworksAnyone who has used the Internet recently knows that it's very possible to develop full-featured applications that happen to use web browsers as their GUI. In the last few years, a plethora of web application development frameworks for Python have been developed. They span a huge gamut, from simple hacks to elaborate systems. Many allow embedding of Python code in HTML, others generate HTML from Python code. Many provide support for persistence, cookie management, URL rewriting, and more. A comparative review of all of these is far beyond the scope of this book. We'll simply mention some of the more commonly used frameworks. 29.7.1 ZopeZope is the grand-daddy of Python web application frameworks. While Zope is open source, it is very much the product of a company called Zope Corp., in collaboration with a vast user community. Zope is a very powerful tool for building content management systems, including such advanced features as replication, transactional support, sophisticated security models and workflow. Zope often stumps people who expect it to be a simple system. While efforts are under way to redesign part of Zope to make learning Zope easier, those who find Zope most useful are typically those with very large or complex websites to build. Information about the Zope software is available at http://www.zope.org, and information about Zope Corp. is at http://www.zope.com. 29.7.2 TwistedIf Zope is the web application server for sites with sophisticated workflow, Twisted is more of a swiss army knife for networked application development. Not strictly focused on the web and the HTTP/HTML standards that anchor the web, Twisted is a framework for building networked applications. Using Twisted, it is relatively easy to build high-performance clients and servers for any protocol, from instant messaging to IRC to HTTP to NNTP. The Twisted framework, like all frameworks, requires a certain learning curve. Those who do learn it do tend to be passionate about it, and it seems to perform admirably. Twisted's home is http://www.twistedmatrix.com. 29.7.3 QuixoteQuixote is a dynamic web application framework built by Python programmers for Python programmers. Unlike many of the alternatives such as Zope, Quixote deliberately does not try to cater to web designers. To use Quixote means to program in Python, even for HTML generation. To those of us who are more comfortable with Python modules and classes than with HTTP redirects, however, that's a great benefit. Quixote has wonderfully clear documentation (at least if you are comfortable with Python) at http://www.mems-exchange.org/software/quixote/. 29.7.4 Webware, Spyce, and MoreThe three systems, Zope, Twisted, and Quixote, while probably among the most popular, do not cover the extent of Python/web frameworks. If embarking on a new project, you owe it to yourself to compare the various frameworks and figure out which one is best for you. Programming on the Web is a complex task with lots of variables—it's very possible that in your particular case, you'd want to use something more like a PHP-style system such as Spyce (http://spyce.sourceforge.net), or more of a component-oriented system like WebWare for Python (http://webware.sourceforge.net/). |
[ Team LiB ] |