gallery/2 ecpsoftware articles diy audio links contact
Setting up Python for CGI on IIS [Win2k Pro]

This is really very easy. This is specifically for Windows 2000 Pro, IIS 5.0. For Windows 2000 Server, see these instructions. For older versions or Windows and IIS you should see http://www.pythonpros.com/arw/pws.html for different instructions.
First make sure that Python is installed, IIS is installed and running, and that you have script permission selected. Once this is all working select

Start | Settings | Control Panel | Administrative Tools | Computer Management

From there, navigate to

Services and Applications | Internet Information Services | -Your Web Site-

You can associate file extensions for individual sites, or for the entire server. To do so right click on either the entire server [IISAdmin], or the place where you want the association to be effective. Select [Properties] from the pop-up menu and press the [Configuration...] button. Select [Add] under the [App Mappings] tab. Next, Browse for python.exe and choose an associated file extension. The path needs quotes if it has spaces, and you need to add -u %s %s to the end.

"C:\Program Files\Python\python.exe" -u %s %s
or
C:\Python20\python.exe -u %s %s

Any script in the covered directories with the associated file extension will be executed by Python. As noted other places, it is probably a good idea to use something other than .py.

Please contact me with questions or comments.