By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,813 Members | 1,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,813 IT Pros & Developers. It's quick & easy.

CGI -> mod_python

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.