473,698 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1427
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
BaseHTTPRequest Handler).

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@rubbis h# cd ~tim/WebStack-1.1.2
root@rubbis h# 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
2287
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 the installer itself seems to be buggy -- in my case, no combination of mod_python 3.0.4, 3.1.2b and python 2.2.3, 2.3.3 ever came to completion. rather, the installer would exit -- after an initial declaration of having successfully found python...
3
4210
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 function that is intended for unified_diff. Does anyone know how to "restore" from a unified diff generated delta? Thanks for all your help in advance. Best Regards, Nick
2
2080
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 off-topic. I'm attempting to get mod_python 3.1.4/python 2.4.1 working on Apache 2.0.54 running under OS X. Apache was compiled from source with a simple /configure --enable-so --with-mpm=worker
0
1796
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: http://www.modpython.org/live/mod_python-3.2.2b/doc-html/modpython.html IT WORKS!
6
1944
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 mod_python 3.1.4 running on Apache 2.0 with the Publisher handler. However, I am still very hesitant to settle on Python. All my research brings up the same collection of scant articles and old mailing list messages that reference each other. I am...
1
4352
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): req.content_type = 'text/plain' req.write("Under Construction")
2
3305
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 recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
5
3108
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 issue ? thanks for any help.
3
1800
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 dynamic; it won't be a static HTML page. In short, I've been looking for a page layout facility using mod_python.
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.