Forums

Importing your own module

If I have a module in my "home" directory, how would I reference it in wsgi.py? Can I just do import foo, or would I have to set a path and what not?

try it! I think that webapps should run with their working directory set to home, so if you have foo.py you should be able to just

import foo

if it doesn't work, then yes a sys.path addition is in order:

import sys
if '/home/rhpt' not in sys.path:
    sys.path.append('/home/rhpt')

The error logs are there to help debugging...