Cameron Laird's personal notes on
Python and the Web
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.
"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:
- Command-line Python scripts control IE
(but equally well through COM [ref]);
- Client-side scripts interpret Python embedded
in HTML as well as they do JavaScript [ref];
- XSLT [ref] style sheets can embed Python
"for stuff too complicated for pure XSLT/XPath";
ActiveState Python subscribes as scripting engine for WSH and MS IE5 in
addition to JavaScript and VBscript.
- "you can write 'hta' applications with full-featured
Python (use of IE5 for GUI)"
(note also Alex Martelli's reservations about event
detection, and his solution of a self-registering
ATL-built DLL ...).
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.
- We featured Zope in WebAdmin columns for WebServer Online
in
December 1998
(when it was still called Principia)
and
April 1999.
We also mention it occasionally in [...]
- Paul Everitt gives a great
interview in August 2000
- Eric Kidd does a great public service by
comparing
Zope with
Frontier.
Paul Everitt and Dave Winer later engage in
public
mutual admiration on the same topic. Since then, Digital
Creations and Userland have
Strategically Allied.
- Steve Litt acutely
describes Zope as software and business.
- Jon Udell
explains
Zope in his reincarnated Byte column.
- Bruce Perens enthusiastically
answers
the question, "What is Zope?"
- Hadar Pedhazur
explains
Zope's operational business model.
- Digital Creations maintains the home page for
Bobo,
A Web Development System.
- Jeff Bauer wrote a nice
tutorial
on setting up Bobo for NT. Notice that, as Jeff writes,
"Even if you have no desire to learn Bobo, you might find the
section covering Python CGI scripts with Apache of interest."
- Rhys Jones gives a stirring
testimonial
to Bobo's desirability.
- Amos Latteier
tells
how Bobo changed his life (even before Digital Creations hired him!).
- [explain PCGI]
- Jeffrey P Shell explains
how
good the Bobo way is.
- Christoper Petrilli briefly
compares
Zope to Cold Fusion and Apple's Web Objects. In the same thread,
Oleg Broytmann succinctly
outlines
Zope's essence.
- I like A. M. Kuchling's
Why
the MEMS Exchange Doesn't Use Zope.
"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.]
Jason Orendorff's
SPY
is "intended
to be exactly like ASP."
Fenster
"ASPy is
a server-side HTML embedded scripting language ..."
[Explain PythonWin's ASP examples.]
SimpleHTTPServer.py is a simple HTTP server.
CGIHTTPServer.py 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".
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.
"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
is a suite of software components for developing web-based
applications."
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."
Brent Fulgham and Titus Brown have launched an interesting
project
to embed Python in the AOLServer.
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
cgipm.py
which makes it easier for newcomers to begin CGI programming with
Python. In April 2000, he launched a
Web
page for it.
The Python Language site includes an entire page of
Web-related
contributions.
Cameron
Laird's personal notes on Python and the
Web/claird@phaseit.net