I’ve got a Python script that is executing functions asynchronously by using PEST wsgi library. However, when I try to import another module it simply results in a 500 error.
The way I try to reference it is:
from foo import *
from foo import Foo
where foo is a file .py in which I have the object that I want to reference to.
Tried to monitor the calls through Chrome’s Inspect Element Control but couldn’t find a thing.
Also tried to debug using Apache’s error log, but nothing there.
Any hints appreciated.
Update:
I’ve tried the following which resulted in the same 500 error:
–make use of
import site
and
site.addsitedir("path/to/my/py/files/folder")
–modify the Apache2 httpd.conf file by inserting the following:
WSGIPythonPath /path/to/my/py/files/folder
–modify the application conf file in /etc/apache2/sites-available/myapp.conf, by inserting the above WSGIPythonPath
Adding
before any other alias or directory in the application conf file really makes the difference.
Problem solved!