python based webserver 
Author Message
 python based webserver

Hey all,

I'm currently working on a project where we need to be able to serve some
test websites. We need to be able to get the server to switch to serving a
different site quickly and easily.

For various reasons we were thinking of building up a server in python to do
this. Mainly to give us some flexability down the road in case we need to
modify the behavior of the webserver.

i was wondering if anyone knows of a webserver written in python? If so, can
someone point me to the source code?

thanks in advance.

replace NOSPAM with merk if replying via email.



Sun, 18 May 2003 08:18:13 GMT  
 python based webserver

Quote:

> Hey all,
> I'm currently working on a project where we need to be able to serve some
> test websites. We need to be able to get the server to switch to serving a
> different site quickly and easily.
> For various reasons we were thinking of building up a server in python to do
> this. Mainly to give us some flexability down the road in case we need to
> modify the behavior of the webserver.
> i was wondering if anyone knows of a webserver written in python? If so, can
> someone point me to the source code?

You get one for free with the standard modules; there's Medusa
(http://www.nightmare.com/medusa/), of course, and I've written one for
my Kura project (http://www.valdyas.org/linguistics).

--

Boudewijn Rempt  | http://www.valdyas.org



Sun, 18 May 2003 14:23:27 GMT  
 python based webserver

| i was wondering if anyone knows of a webserver written in python? If so, can
| someone point me to the source code?

there is one in the standard library. have a look at the BaseHTTPServer
module and friends.

 -- erno



Sun, 18 May 2003 15:35:52 GMT  
 python based webserver
Just to confirm the already mentioned recommendation of medusa. A very nice
little program.

Richard shar



Quote:
> Hey all,

> I'm currently working on a project where we need to be able to serve some
> test websites. We need to be able to get the server to switch to serving a
> different site quickly and easily.

> For various reasons we were thinking of building up a server in python to
do
> this. Mainly to give us some flexability down the road in case we need to
> modify the behavior of the webserver.

> i was wondering if anyone knows of a webserver written in python? If so,
can
> someone point me to the source code?

> thanks in advance.

> replace NOSPAM with merk if replying via email.



Sun, 18 May 2003 03:00:00 GMT  
 python based webserver


Quote:

> > Hey all,

> > I'm currently working on a project where we need to be able to serve
some
> > test websites. We need to be able to get the server to switch to serving
a
> > different site quickly and easily.

> > For various reasons we were thinking of building up a server in python
to do
> > this. Mainly to give us some flexability down the road in case we need
to
> > modify the behavior of the webserver.

> > i was wondering if anyone knows of a webserver written in python? If so,
can
> > someone point me to the source code?

> You get one for free with the standard modules; there's Medusa
> (http://www.nightmare.com/medusa/), of course, and I've written one for
> my Kura project (http://www.valdyas.org/linguistics).

> --

> Boudewijn Rempt  | http://www.valdyas.org

ok thanks, i'll take a look at that.

I put something together so far using the basehttpserver. I do have one
problem with it though...i cant seem to get it to stop running. I have it
set to serve_forever()...and i am doing ctrl-c or just killing the PID to
shut it down. But then i have to wait a minute before i can start it up
again since it says the port is still in use. Is there a clean way to shut
it down?

thanks for the help...i'll go look at medusa now...using a mirror of course
:)p



Sun, 18 May 2003 03:00:00 GMT  
 python based webserver

    ian> I put something together so far using the basehttpserver. I
    ian> do have one problem with it though...i cant seem to get it to
    ian> stop running. I have it set to serve_forever()...and i am
    ian> doing ctrl-c or just killing the PID to shut it down. But
    ian> then i have to wait a minute before i can start it up again
    ian> since it says the port is still in use. Is there a clean way
    ian> to shut it down?

override the server_bind method and put
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
there. (also call the base class version)

this happens automagically in python 2.0 (i think), so you might want to
upgrade.

for some explanation, look up SO_REUSEADDR in the unix socket faq.

  -- erno



Mon, 19 May 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Adding CGI-capabilities to a BaseHTTPServer/BaseHTTPRequestHandler-based webserver

2. Using Python with a webserver

3. Python + Windows + Webserver

4. Are There Free Webservers With Python Supported?

5. Python Webserver

6. Python CGI on Mac webserver

7. How to setup webserver for Python

8. Python Distribution for Webserver on netfirms.com

9. Python-based IRC bots..and a #python channel

10. smalltalk or python for persistence-based app?

11. Ribosome - a Python-based build system

12. PythonCAD - A Python-based CAD program

 

 
Powered by phpBB® Forum Software