Importing modules for cgi's

Steve Holden sholden at holdenweb.com
Fri Dec 21 13:18:11 EST 2001


"Daniel" <dlNONNSPAMrubin at yahoo.com> wrote ...
> Hi,
> I installed a database api module in python and added the path to my
> PYTHONPATH. In order for my cgi to work, though, I have to invoke my cgi
> from a shell script that first sets the PYTHONPATH so the module will be
> foud when the cgi runs. Is there a simpler way? I'd prefer not having to
> have the shell script. Is there a way for python to always know about my
> module without using PYTHONPATH?
>
> Another thing I tried that doesn't work is modifying sys.path at the
> start of the cgi script. It seems that this has to be set (via the shell
> script) before the cgi script starts.
>
Modifying sys.path *should* work. Are you sure you dodn't make a mistake?
Try sending the code in your posting to see if someone can spot a mistake...

regards
 Steve





More information about the Python-list mailing list