local moduile acess from cgi-bin

N

noro

hello all.

I do some coding in python but this is my first attampt to write
somthing for hte web.

I need to write a cgi-bin script for a web-server, and i've got the
access for it from our "SYSTEM". the problem is that this script uses
some modules (pg, pyLab) that i've installed localy in my home dir.
Python knows how to find them due to an enviorment variable inthe shell
(please corrent me if i'm wrong).

now, i am by no means big expert about web servers, but if i got it
right, the web server run under some user ("www-data" or such).
so howi can i make this user (and the web) be able to run my python
code without having to install the modules as shared. (which i dont
think they will allow me).

thanks very much
amit
 
B

Bruno Desthuilliers

noro said:
hello all.

I do some coding in python but this is my first attampt to write
somthing for hte web.

I need to write a cgi-bin script for a web-server, and i've got the
access for it from our "SYSTEM". the problem is that this script uses
some modules (pg, pyLab) that i've installed localy in my home dir.
Python knows how to find them due to an enviorment variable inthe shell
(please corrent me if i'm wrong).

now, i am by no means big expert about web servers, but if i got it
right, the web server run under some user ("www-data" or such).
so howi can i make this user (and the web) be able to run my python
code without having to install the modules as shared. (which i dont
think they will allow me).

import sys
sys.path.append('/home/amir/<wherever-your-modules-are>')

should do the trick.

HTH
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top