CGI -> mod_python

Discussion in 'Python' started by bernhard.heinzel@gmail.com, Oct 3, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. On Mon, 02 Oct 2006 22:07:26 -0700, ""
    <> let 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
     
    Thomas Jollans, Oct 3, 2006
    #2
    1. Advertising

  3. Guest

    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/current/doc-html/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, 2006
    #3
  4. Paul Boddie Guest

    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
     
    Paul Boddie, Oct 3, 2006
    #4
  5. Jon Ribbens Guest

    In article <>, 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/
     
    Jon Ribbens, Oct 3, 2006
    #5
  6. 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
     
    Eric S. Johansson, Oct 3, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jürgen Exner

    Re: CGI Perl "use CGI" statement fail

    Jürgen Exner, Jul 31, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,355
    Jürgen Exner
    Jul 31, 2003
  2. Shailan
    Replies:
    2
    Views:
    975
    Shailan
    Dec 15, 2003
  3. Tim Chase
    Replies:
    4
    Views:
    552
    Tim Chase
    Apr 16, 2006
  4. blbmdsmith
    Replies:
    1
    Views:
    648
    Graham Dumpleton
    Dec 14, 2006
  5. Re: CGI vs mod_python

    , Nov 9, 2009, in forum: Python
    Replies:
    2
    Views:
    349
    Dave Angel
    Nov 11, 2009
Loading...

Share This Page