creating a small test server on my local computer

Tim Chase python.list at tim.thechases.com
Fri Sep 29 15:37:16 EDT 2006


>> Why do you need to use Python for the server?
> 
> Well, perhaps I don't know what I'm talking about. I'm on an XP machine 
> and I just needed a way to test my web pages, and I thought Python could 
> be used to create a server to do this. But I know nothing about network 
> programming...

Well, you could investigate WebStack:

http://www.boddie.org.uk/python/WebStack.html
http://cheeseshop.python.org/pypi/WebStack/1.1.2

which allows you to develop for a variety of deployment targets, 
inter alia CGI, mod_python, and BaseHTTPServer.  The last is nice 
as you can run it on your local machine for testing.  Then, to 
deploy to another environment, you just tweak one file (your 
adaptor file) to change from, say, BaseHTTPServer to mod_python.

The documentation is a bit terse, and lacking in some areas, but 
a little debugging output goes a long way toward diagnosing 
problems with your code.

In my experience, it takes targeting WebStack's abstraction 
framework rather than any of the particular platforms, but the 
portability is unbeatable.

Just a satisfied customer of Boddie's work,

-tkc







More information about the Python-list mailing list