It is possible, but it is terribly inconvenient. A mod_python program
has to talk directly to Apache APIs. It's not like the CGI model, where
you read parameters from stdin, and then send headers and HTML to
stdout. Also remember that it's a pain in the rear during development,
because you may need to restart Apache every time you change your script.
mod_python is somewhat interesting technology, but it is only a solution
for a very narrow range of problems. I've done dozens of Python-based
web sites, and I've never used it.
Don't discard the possibility of straight CGI, especially in early
development. It is clearly the easiest to configure, and requires no
special permissions on remote hosting services. And unless you are
handling several hundred requests a minute, the performance is entirely
adequate.
> For now, after reading up some articles I get the impression that I
> would be better off using a HTTP framework. I decided to try Cherrypy
> and was following instructions on http://cherrypy.org/wiki/DeployTemplate
>
> I don't want to run the Cherrypy builtin server but only want to run
> apache.
Why? The CherryPy builtin server is quite capable, and by using the
Apache proxy method, your users will not be able to tell the
difference. What problems do you fear in using the builtin server?
> Also. I'm mostly a Java programmer and have no idea how I should write
> a module which accepts GET and POST requests and have these methods
> called when a particular URL is invoked. I did find some example code
> but I'm not sure if any changes need to be made to httpd.conf to say
> something to the effect of 'call this method on invocation of this
> URL'.
>
The CherryPy tutorials should answer much of this. You shouldn't really
need any changes in httpd.conf. Using the proxy method, I use an
.htaccess file in a given directory that routes all requests within that
directory to my CherryPy app. The CherryPy machinery then searches for
a handler for the next part of the URL using its normal dispatch mechanism.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Robert Brewer
fuma...@aminus.org