[mod_python] cgi handler

Graham Dumpleton graham.dumpleton at gmail.com
Sun Apr 8 23:38:38 EDT 2007


Code works fine for me on mod_python 3.3.1, Python 2.3.5 and Apache 2.2.1.

Thus, nothing wrong with the code itself.

Can you be more precise about which version of mod_python they are using?

On 09/04/07, Philippe Schottey <phillscot at mac.com> wrote:
> Indeed, only the cgi_handler is configured.
> Versions:
> python 2.3
> apache 2
> mod_python 3.*
>
> The (test) script I have is:
>
> from mod_python import apache
> import cgi
>
> form = cgi.FieldStorage()
>
> print """Content-type: text/html
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
>     <head>
>         <title>test</title>
>     </head>
>     <body>
>         """
> print form.has_key('action')
> print """
>     </body>
> </html>"""
>
>
>
> On 09 Apr 2007, at 03:52, Graham Dumpleton wrote:
>
> On 09/04/07, Philippe Schottey <phillscot at mac.com> wrote:
> Hello,
>
> This is the first time i'm using python and mod_python.
> The hosting company only wants to use the cgi_handler.
>
> Can you confirm that what you mean is that the web hosting company is
> only allowing you to use as the handler for mod_python:
>
>  PythonHandler mod_python.cgihandler
>
> Just want to confirm so that we know for sure that you aren't just
> using standard CGI.
>
>
> I have some problems retrieving POST and GET parameters.
> I've read somewhere that this should do the trick:
>
> import cgi
> form = cgi.FieldStorage()
> value = form[key]
>
> Can you perhaps show a more complete script?
>
> Also, which version of mod_python is being used and which version of Python?
>
> Graham
>
>
> When I'm trying this, the form object is allways empty.
> The form code:
>  <form name="main" action="test.py" method="POST">
>  <input type="hidden" name="action" id="action" value="good"/>
>             <input type="submit"/>
>  </form>
>
> I can't seem to retrieve the action parameter.
>


More information about the Mod_python mailing list