Can someone give me a pointer on why I need to add the project root path to the python path, as well as the application itself in my WSGI file?
The base of the project is called "djapp", the application is called "myapp".
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..') sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../djapp') os.environ['DJANGO_SETTINGS_MODULE'] = 'djapp.settings'
If I omit the line with "/../djapp/", the log tells me that "myapp" cannot be imported, although "djapp.settings" is. (check "djapp" has been imported)
It works correctly with the team. /manage.py. there __init__ in the project folder.
For tests, I see the same problem using addsitedir :
site.addsitedir('/home/user/web/project/') site.addsitedir('/home/user/web/project/djapp')
django django-wsgi
GerardJP
source share