1.5.1 Frameworks

httpy is a Python library for building websites and web applications. To understand how it differs from the glut of Python web programming libraries and frameworks already on the market, consider for a moment this diagram of the web stack:

                   The Web Stack
                   =============

  ^                    etc.
  |                 JavaScript
                       CSS
client                XHTML

network                HTTP

server            compiled server
                      gateway
  |
application --->       [  ], security, templating, persistence, etc.
  |
  |                   Python
  |                  database
  v              operating system
                       etc.

Python web programming packages fit in the empty spot in this diagram. Now, other packages generally start out on the "application" arm of this diagram. In other words, they start with the concept of the application, and give that concept expression as a Python object model.

httpy takes the opposite tack. Instead of starting with a variable - the application - httpy starts with the constants: HTTP above us, and Python below us. (The "compiled server" and "gateway" are also variables, of course, and may not be present at all.) In other words, since every web application is an HTTP application at heart, httpy starts there, and develops a simple object model based on the HyperText Transmission Protocol itself. The premise here is that HTTP - mature, well-documented, ubiquitous - is a much surer foundation than any one individual's notion of how your website should be modeled.

Here's another way to think about it: websites are complex! Ask 10 people to model a website using Python objects, and we end up with 20 different answers. Ok, so let's try to narrow the problem down slightly: what are the relatively fixed points in this discussion? HTTP coming from the client, and Python waiting on the server. Well then, if we can give HTTP a compelling Python object representation, then we will have squeezed out that much complexity from the problem.

httpy is Zeta software. It is copyright © 2006 by Chad Whitacre, and is offered free of charge, warranty, and restrictions.