Got Python web host, yay! Now what?

Tyler Eaves tyler at tylereaves.com
Fri Aug 22 04:24:58 CEST 2003


On Thu, 21 Aug 2003 16:47:07 +0000, Robert Oschler wrote:

> I found a good web host that has Python 2.x support and I've set up an
> account.  It's LunarPages.com if you're interested .  Do I have to do
> anything special to run Python scripts, besides upload the script to the
> cgi-bin directory?  If so, please direct me to a good web page or doc that
> goes into the necessary details.
> 
> thx
> 
> --
> 
> Robert Oschler


3 things to watch out for

1. Make sure permissions are set to 755 (chmod 755 yourscript.py)

2. Make sure the 'bang' line (the first line of the file) is correct.
   If python is at /usr/bin/python, the first line of the file should 
   be exactly #!/usr/bin/python 

3. Make sure your script outputs a Content-type (and possibly other, as
   needed) headers.

   Code sample:

   print 'Content-type: text/html'
   print ''





More information about the Python-list mailing list