local moduile acess from cgi-bin

Discussion in 'Python' started by noro, Jul 25, 2006.

  1. noro

    noro Guest

    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
     
    noro, Jul 25, 2006
    #1
    1. Advertising

  2. noro wrote:
    > 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
    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
     
    Bruno Desthuilliers, Jul 25, 2006
    #2
    1. Advertising

  3. noro

    noro Guest

    thanks bruno

    Bruno Desthuilliers wrote:
    > noro wrote:
    > > 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
    > --
    > bruno desthuilliers
    > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    > p in ''.split('@')])"
     
    noro, Jul 26, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Mitchell

    Can "bin" be changed to "cgi-bin" for asp.net

    Kevin Mitchell, Oct 19, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    915
    Wim Hollebrandse
    Oct 19, 2003
  2. John Salerno
    Replies:
    30
    Views:
    2,004
    Stephan Kuhagen
    Aug 10, 2006
  3. anne001
    Replies:
    1
    Views:
    530
  4. zippy

    cgi and cgi-bin

    zippy, Feb 1, 2005, in forum: Perl Misc
    Replies:
    5
    Views:
    398
    Sam Holden
    Feb 2, 2005
  5. BestFriend
    Replies:
    2
    Views:
    842
Loading...

Share This Page