Unified web API for CGI and mod_python?

T

Tim Chase

I've been digging around, but can't seem to come up with the
right combo of words to google for to get helpful results. Is
there some handy wrapper/module that allows code to target
existance as both a CGI script and a mod_python script, with only
one "import" statement? Perhaps some common object model?

I've got CGI access on one server, and mod_python on
another...I'd prefer to use mod_python for the reduced overhead
(my own performance testing seems to indicate it's got a good
lead over CGI), but it's not as available on various hosting
services as CGI access is.

Thanks,

-tkc
 
P

Paul Boddie

Tim said:
I've been digging around, but can't seem to come up with the
right combo of words to google for to get helpful results. Is
there some handy wrapper/module that allows code to target
existance as both a CGI script and a mod_python script, with only
one "import" statement? Perhaps some common object model?

You could try WebStack - it provides a common API which would probably
be suitable for your purposes:

http://www.python.org/pypi/WebStack

The PythonInfo Wiki [1] has a WebProgramming page which also gives
information about the different frameworks and standards.

Paul

[1] http://wiki.python.org/moin/
 
T

Tim Chase

I've been digging around, but can't seem to come up
You could try WebStack - it provides a common API which
would probably be suitable for your purposes:

http://www.python.org/pypi/WebStack

Paul,

I meant to thank you (even if I already have) for this link
as it's just what I've been looking for. Thanks!

I've had some trouble installing it on one of my boxes and
was hoping you might be able to tell me where I've gone awry:

It's a Debian/Testing box with Apache 1.x running with both
CGI and mod_python enabled for testing purposes (my aim is
to make use of at least the CGI, mod_python, and
BaseHTTPRequestHandler).

When I run the setup.py script (either as myself or as root)
I get back


root@rubbish# cd ~tim/WebStack-1.1.2
root@rubbish# python2.3 setup.py install
running install
error: invalid Python installation: unable to open
/usr/lib/python2.3/config/Makefile (No such file or directory)



Now this makes sense, as I don't have a config/ in my
/usr/lib/python2.3 directory. However, I've not had trouble
with any other packages (though everything else has been
added via apt-get, not via setup.py files). Is this a file
that should be there? If so, where would I go about finding
it? If not, is there a simple way to do an install without
setup.py (or to tell setup.py to "get over it")? Or is
there a Debian repository with a .deb package for it that I
can point at (I noticed you may have some Debian sort of
leaning while hunting through the help)?

Push come to shove, it would be possible to manually copy
files to their associated locations: docs and apidocs to a
WebStack directory in /usr/share/docs, and the WebStack
python files to /usr/lib/python2.3/WebStack ...is there
anything else I'm missing here?

Thanks,

-tim
 
A

Alexis Roda

Tim Chase escribió:
>
root@rubbish# cd ~tim/WebStack-1.1.2
root@rubbish# python2.3 setup.py install
running install
error: invalid Python installation: unable to open
/usr/lib/python2.3/config/Makefile (No such file or directory)

apt-get install python2.3-dev


HTH
 
T

Tim Chase

root@rubbish# cd ~tim/WebStack-1.1.2
apt-get install python2.3-dev

Worked like a charm, and the WebStack install took place
uneventfully. Only took half an hour to download the .deb
packages over dialup :-/

Thanks for your help!

-tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top