CGI on Windows
Rainer Mansfeld
MLists at romulo.de
Mon May 16 14:08:44 EDT 2005
Hi all,
I'm running the following script as a minimalistic CGI server on
Windows ME:
httpd.py
--------
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
server = HTTPServer(("", 8080), CGIHTTPRequestHandler)
server.serve_forever()
This works fine showing html files and even running python scripts.
However if I try something like
http://localhost:8080/cgi-bin/Test.py?key=123
using the following script:
Test.py
-------
import cgi
form = cgi.FieldStorage()
value = form.getfirst('key', "???")
print "Content-Type: text/html"
print
print "value = %s" % value
it shows 'value = ???' in the browswer.
In other words cgi.FieldStorage is empty.
Using a form and the 'POST' method doesn't help either.
On a 'real' Internet server (Linux/Apache) the same script works
without problems. So my conclusion is, that either the CGIHTTPServer
or the cgi module don't work on Windows, but I can't find anything
about this issue in the documentation or using Google.
Any hints?
Thanks in advance
Rainer
More information about the Python-list
mailing list