Cameron Laird's personal notes on Python and the Web

Key Resource
Links2Go Key Resource
Python Topic

Table of contents

To pursue this topic, read Python Web Programming, which generally provides more detail than I can. Also, in 2002, the Wiki is starting to take off; that's where new content should appear.

Client-side Web Python programming

"Grail is an extensible Internet browser written entirely in the interpreted object-oriented programming language Python."

Grail wasn't even the first Web browser built with Python. In fact, part of the advice Marc Andreesen received when working on Mosaic was Guido's, based on his earlier (before Mosaic, but after Viola) construction of a nice little stdwin-based Python-coded Web browser.

A different flavor of client-side Python scripting is that Mark Hammond's [ref] hard work has made possible. Internet Explorer (and WSH [give ref]) support(s) ActiveScripting [ref] languages, including Python. Thus, as Gilles Lenfant enumerated in private correspondence:

(note also Alex Martelli's reservations about event detection, and his solution of a self-registering ATL-built DLL ...).

Server-side Web Python programming


Zope is the free, open source web application platform formerly known as Principia. It's a powerful, reliable way to build high-performance, dynamic web sites.

CGI and relatives

"Whiz is a tool geared toward straightforward creation of CGI applications (things that guide a user through a process)."

Alex Martelli explains FastCGI, Xitami, LRWP, ....

Andreas Jung has a very primitive Wrapper for embedding Python in HTML pages.

Among many tutorials written on Python and CGI is the article called "Writing CGI Programs in Python".

[Other refs.]

ASP-related methods

Jason Orendorff's SPY is "intended to be exactly like ASP."


"ASPy is a server-side HTML embedded scripting language ..."

[Explain PythonWin's ASP examples.]

Pure-Python Web service is a simple HTTP server. is a CGI-savvy HTTP server.

"Medusa is an architecture for building long-running, high-performance network servers in Python."

Hannu Krosing has written small prototype WWW servers.

Python offers a wealth of facilities to those who want to "roll their own" network services: socket, {ftp,http,gopher,...}lib, urllib, SocketServer, and asynclib are other available standard modules. Moreover, Python is the reference implementation for ILU (and perhaps soon for other CORBA services). For content HTMLgen and HTMLfmt ...


The eGenix Application Server emphasizes object-oriented information design for Web pages. A trademarked PythonHTML scripting variant specifies content. eGenix includes the goodies one expects from a commercial product in this domain: Web-based administration, directory lookup, authoring authentication, data-management methods, session variables, fail-over capability, and so on. Its extensibility--through both subclassing of exposed server classes and configuration of control objects--is interesting.

eGenix is based on Apache. The first release is only for x86 Linux; other Unix variants are scheduled to appear in 2001.


Gregory Trubetskoy has moved his efforts, formerly labeled httpdapy, to an almost completely rewritten mod_python.

Andreas Jung is considering implementing PMZ in mod_python.


"mod_snake was created in an attempt to give Apache 1.3 and 2.0 developers the power to create easy and flexible modules in the Python programming language. Aside from giving modules the same power as they have in C, mod_snake also provides APIs similar to that of mod_python and mod_perl for simple module creation, accelerated Python CGIs, and embedded Python." Jon Travis also told me that
The major differences between mod_snake and mod_python is that mod_snake additionally allows modules to create their own directives, works in the upcoming Apache 2.0, as well as 1.3, allows developers to embed Python within their HTML documents, and gives them more power and flexibility with interfacing to Apache.

mod_perl did a good job with getting external scripting started for the Apache server. mod_snake gives users similar functionality in Python but extends it to a more object oriented feel. mod_snake modules are actual objects on a per-server basis, and as such they can store any information they wish in a clean and safe way. They also handle per-directory information in the same way that C-modules do, by passing around their own created configuration.


PyServ is "a servlet-like engine for Python".

Python Server Pages

The original is Kiby W. Angell's "baby", which he explains in the January and February 2000 issues of Dr. Dobb's Journal. While I haven't yet constructed a unified on-line explanation of PSP, this sample gives some feel for its operation.

To my continuing confusion, Jon Brisbin has created a somewhat different system for which he uses the same name. [technical comparison]


Quixote supports the Python Template Language (PTL), a predictable scheme for embedding executable content in HTML. One correspondent in particular told me privately that he "like[s] its approach embedding HTML in Python code."

An important paper by Andrew Kuchling illustrates Quixote's use as an "application server" in conjunction with the ZODB persistence store to support the MEMS Exchange.

Python with Apache, Netscape's Enterprise Server, and other specialties

"Httpdapy allows embedding Python within a webserver for a considerable boost in performance and added flexibility in designing web based applications." It's a plugin for both Enterprise Server (in which case it's called NSAPY) and Apache. It's closer to mod_perl in design and performance than pyapache is.

[Explain PyApache--CGI-compatible, put limited in performance by its need to spawn an interpreter instance for each page.]

[Other refs.]

[Explain Sioux, ...]


"Wasp is a platform-independent open-source HTML preprocessor and CGI framework written in Python." The completeness of Robin Parmar's documentation and the dual-mode (static or dynamic) operation of Wasp are particular benefits.

Webware for Python

"Webware for Python is a suite of software components for developing web-based applications."

Poor man's Zope

Andreas Jung characterizes his creation, "an external handler for the Apache web server," as "very similar to Active Server Pages or PHP3/4".


"Zebra is an XML-based preprocessing language that provides a compact syntax for expressing common web design patterns." As of April 2000, it best supports Python and PHP as target languages.

Author Michal Wallace is "also working on a library called weblib, which simulates the Request and Response objects from ASP, as well as the Session, Authentication, and Permission classes from the PHP base libraries."

AOLServer for Python

Brent Fulgham and Titus Brown have launched an interesting project to embed Python in the AOLServer.

Other aspects of Python and the Web: tutorials, books, and more

Several ISPs are friendly to Python.

[Explain Internet Programming ....]

Aaron Waters, author of Internet Programming with Python, has written on a number of aspects of a Python-ized Web, including

D'Arcy J.M. Cain offers examples of Python CGI scripts.

Writing CGI scripts in Python; reference manual for Standard Module cgi

[Other refs.]

Harry G. George offers a nice which makes it easier for newcomers to begin CGI programming with Python. In April 2000, he launched a Web page for it.

Other on-line sites for information about Python Web programming

The Python Language site includes an entire page of Web-related contributions.
Cameron Laird's personal notes on Python and the Web/