2

Hi I am using mod_python and I have a python module AA in a directory X and in directory X I have sub directories which has other modules which are imported in AA. I am importing AA in BB. when I run BB it fails to load modules imported in AA.

It's a python path issue, but the issue is how to dynamically set the path to the users workspace.

the workspace differs for each users.

Please help me on this.

to update I am using

sys. path.append(classpath)

in my BB script but still it fails.

my vhost file has following added in Directory tag :

AddHandler cgi-script .py
PythonHandler mod_python
PythonDebug On
user954299
  • 185
  • 5
  • 15

1 Answers1

0

Python path can be added using the PythonPath directive. It should work in the server, virtual host, directory and .htaccess contexts.

PythonPath "['/path/to/site1', '/path/to/site2']"

http://modpython.org/live/current/doc-html/directives.html#pythonpath

Boris
  • 2,225
  • 20
  • 20