473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Unified web API for CGI and mod_python?

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

Jan 24 '06 #1
4 1415
Tim Chase wrote:
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/

Jan 24 '06 #2
>> 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


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



Apr 15 '06 #3
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
Apr 16 '06 #4
>>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


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


Apr 16 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wolf | last post by:
i would like to briefly share my experiences with installing mod_python on a w2000 box. i must say that i believe the installation process to be unnecessarily complicated by the simple fact that...
3
by: Nick Allen | last post by:
After using ndiff from difflib, the function restore would return the sequence that generated the delta. Unfortunately, restore does not do the same for unified_diff. I do not see any similar...
2
by: Robert J. Hansen | last post by:
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but "comp.lang.python.web" doesn't seem to exist, so... my apologies in advance if this is considered...
0
by: Python_it | last post by:
I'm going to work with mod_python. I install mod_python 3.2.2b for python 2.4. If i test my install with mptest.py see this link:...
6
by: Anthony L. | last post by:
I am writing a web application that is comparable to a content management system used in blogging. I really want to use Python after having done some evaluation coding using Python 2.3.5 with...
1
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req):...
2
by: exhuma.twn | last post by:
Hi again, as soon as I try to make use of the "session" object inside a psp-template file, I get the following error: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most...
5
by: m.banaouas | last post by:
Hi, bonjour, witch versions are suitable to use for apache & mod_python ? Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent versions) without facing any known major...
3
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the PSP/include solution. Furthermore, the header will be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.