I'm desperate. I'm trying to deploy an existing django app on pythonanywhere, and I stucked at the popular error: ModuleNotFoundError: No module named 'sw.settings'
. My WSGI (at var/www
):
import os
import sys
path = '/home/SamperMan/sw' # There is manage.py
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'sw.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
I've read DebuggingImportError page and everything here works fine:
(mysite-virtualenv) 14:14 ~/sw (master)$ python -i /var/www/samperman_pythonanywhere_com_wsgi.py
>>> import sw.settings
>>> sw.settings.BASE_DIR
'/home/SamperMan/sw'
>>>
I've configured web app settings (set a Source code and VirtualEnv settings), installed django on the new virtualenv. I really don't know where could I miss something? What mistake can it be?