473,386 Members | 1,758 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,386 software developers and data experts.

CGI -> mod_python

Hi,

it is a kind of nooby question. Is there a way to transfer a CGI python
script to mod_python without rewriting the code?

Thanks.
Bernhard

Oct 3 '06 #1
5 1178
On Mon, 02 Oct 2006 22:07:26 -0700, "be**************@gmail.com"
<be**************@gmail.comlet this slip:
Hi,

it is a kind of nooby question. Is there a way to transfer a CGI python
script to mod_python without rewriting the code?
Not that I know of, but thanks to the WSGI (specified in PEP 333:
http://www.python.org/dev/peps/pep-0333/) you should be able to convert
your app to WSGI, which will run on mod_python, relatively easily
(depending on your code; 'print' won't work anymore)

--
Thomas Jollans alias free-zombie
Oct 3 '06 #2

be**************@gmail.com wrote:
Hi,

it is a kind of nooby question. Is there a way to transfer a CGI python
script to mod_python without rewriting the code?
Did you look in the mod_python documentation?

http://www.modpython.org/live/curren.../hand-cgi.html

It certainly isn't the preferred way of using mod_python. You really
should consider porting it properly to either mod_python or as
someone else suggested, WSGI.

Graham

Oct 3 '06 #3
be**************@gmail.com wrote:
>
it is a kind of nooby question. Is there a way to transfer a CGI python
script to mod_python without rewriting the code?
Had you used WebStack [1] to begin with, this migration would involve
changing a few lines of glue code. However, as others have pointed out,
WSGI may be an appropriate API to target for a modest rewrite of the
code, given substantial resemblances to aspects of the CGI API.

Paul

[1] http://www.python.org/pypi/WebStack

Oct 3 '06 #4
In article <11**********************@m73g2000cwd.googlegroups .com>, Paul Boddie wrote:
>it is a kind of nooby question. Is there a way to transfer a CGI python
script to mod_python without rewriting the code?

Had you used WebStack [1] to begin with, this migration would involve
changing a few lines of glue code.
Or Jonpy ;-)

http://jonpy.sf.net/
Oct 3 '06 #5
Thomas Jollans wrote:
Not that I know of, but thanks to the WSGI (specified in PEP 333:
http://www.python.org/dev/peps/pep-0333/) you should be able to convert
your app to WSGI, which will run on mod_python, relatively easily
(depending on your code; 'print' won't work anymore)
I assume this is the library one could use if you were running on Python
2.3 or 2.4

http://cheeseshop.python.org/pypi/wsgiref

--- eric
Oct 3 '06 #6

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

Similar topics

0
by: Lorenz Köhl | last post by:
hi, I've python 2.3 and apache 2.0.47 installed on my SuSE8.2. when trying to compile modpython into apache, make stops with the error ---- In file included from...
0
by: Julio C?sar Carrascal | last post by:
Hi. I'm interested in learning ModPython to develop a web application. What are my options in terms of embedding python in HTML?. I know there are several products arround but I would like to...
2
by: Sam | last post by:
Hi All, I am interested in learning python since I am hearing more and more about python for use in web development I am starting out on python, with knowledge of PHP some perl my current...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
0
by: EP | last post by:
Hi i am gettng slow response from thssite en wonder if problem with gil? or django bug. is this coded in modpython and to many instances? i need to select web teknology en maybe python en zope...
9
by: cyberco | last post by:
And I thought this would be trivial...getting mod_python to run within apache on windows XP. ============= mod_python 3.2.8 apache 2.0.55 python2.4 winxp =============
2
by: Sai Krishna M | last post by:
Hi, I have been working for some time developing web pages using python, modpython, cheetah. I find that this method has come inherent difficulties in it like if we want to generate a single...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
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,...
0
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,...

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.