Entry
What files do I need on my web server to use Python for CGI?
Mar 3rd, 2000 20:15
Nathan Wallace, Harry George, Kalle Svensson
Your cgi script is a normal python script -- which means it needs the
normal python infrastructure (e.g., the interpreter and the std
libraries). If your homepage is on an ISP which does not support
python, that could be trouble. You could ask the ISP to install
python, so you can use it.
You will at least need the main script file plus any modules it uses
that are not in the standard library. On some webhosts, you will also
have to rename the main script file with a .cgi extension. If the
script uses any data files, you will have to upload them too.
Also remember, if you usually do
#!/usr/bin/env python
You may have to do:
#!/usr/bin/python (or whatever the actual absolute path may be)
(It is probably a poor idea to try to pick just a few of the std
libraries to upload, since you need the interpreter anyway.)