Local Python Server Installation

Gerhard Häring gerhard.haering at opus-gmbh.net
Fri Sep 20 19:36:21 CEST 2002


In article <3d8b47c6.277669 at news.jaring.my>, Kenneth Gomez wrote:
> Dear Group,
> 
> I would like to know wich software to install if I would like to learn
> to use Python as a web development tool? 
> 
> I have installed Python 2.2.1 and Apache but I belive I would need a
> Python Server Program to enable Apache to render .py files, am I
> right?
> 
> Could you kindly advise me? 

Add this line at the end of your .../Apache Group/Apache2/conf/httpd.conf:

    ScriptInterpreterSource Registry

Then you can write Python CGI scripts that have the .py extension. I
recommend to create a test.py script with the following two lines:

import cgi
cgi.test()

After you verify that this works (http://localhost/cgi-bin/test.py) you can
continue reading the documentation about the cgi module and writing your
own CGI scripts. The cgitb and Cookie modules should come in useful, too.

If you experience the limits of CGI one day, you can think about using a
full-blown appliation server like WebWare.

-- Gerhard



More information about the Python-list mailing list