Hello,
I have some modules which I need to include in my web2py application. They
are scattered around the filesystem (I am still in the development phase
and I have not properly packaged anything). The PYTHONPATH is properly
configured to access all my modules: python can find my modules when
running it from the command line.
I have verified that the web2py server is also "seeing" the proper value
for PYTHONPATH, by deactivating my import statements and doing this:
def index():
open('/tmp/xxx', 'w').write("PYTHONPATH=%s" %
(os.environ['PYTHONPATH']))
redirect(URL('static','output/Portal.html'))
(I have done this because I do not know how to use simple "print"
statements in web2py. I guess the rendering engine gives a special meaning
to stdout)
So now I am sure that the web2py process has access to the PYTHONPATH. But
still no luck when I reactivate my import statements. I get a ticket,
stating that there are import problems. I have taken a detailed look at the
context/request and indeed the PYTHONPATH is not available, neither on
"env" nor on wsgi/environment. So I do not understand anything.
os.environemnt has the PYTHONPATH but the request does not nothing about it?
What is worse: why can python not find my modules when os.environment has
the PYTHONPATH properly set up?
Thanks,
Daniel
--