Got Python web host, yay! Now what?

R

Robert Oschler

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
"Let the web hear you, add your voice to your web site in minutes!"
-- http://audiodirect.spiderchase.com/
(For a limited time, free voiceover with every sign-up, use this link
instead)
-- http://audio.spiderchase.com/
(A song - are you blue?)
-- http://bluedreams.spiderchase.com/
 
S

Sheila King

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

This will depend on the set up that your web host provides.

On the server where I host, I simply upload my scripts to cgi-bin and they
run.

However, I recently helped someone set up a script on a different server,
and after a couple of hours of tearing our hair out, we found out that on
that server, all scripts had to be renamed to have a .cgi extension, or
they would not run. (I've usually run my scripts with a .py extension.)

So, you should check with your host to find out what requirements they may
have for running cgi scripts.
 
T

Tyler Eaves

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


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 ''
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top