return a default form with BaseHTTPServer

Jeff Gercken jgercken at gmail.com
Mon Jan 9 10:58:09 EST 2006


I want my http server to return a default form, regardless of the GET
request, but I'm a bit of a noob and have no idea how.  I'm trying to
write a platform-independent captured portal for my wireless AP.  This
is what I have:

#!/usr/bin/env python
import CGIHTTPServer
import BaseHTTPServer
class ServerHandler(CGIHTTPServer.CGIHTTPRequestHandler):
    cgi_directories=[ '/cgi-bin' ]
httpserver = BaseHTTPServer.HTTPServer(("", 80), ServerHandler)
httpserver.serve_forever()

Many thanks,
Jeff



More information about the Python-list mailing list