Forums

Settings.py in correct position but getting an ImportError: No module named comic_kollector_2.settings

Hi, My settings file is in the exact place as specified in the WGSI file, however it is still getting an import error. Django is installed and the VM is active.

WGSI file is below;

+++++++++++ DJANGO +++++++++++

import os import sys

path = '/home/johnpearson81/comic_kollector_2' if path not in sys.path: sys.path.insert(0, path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'comic_kollector_2.settings.py' from django.core.wsgi import get_wsgi_application application = get_wsgi_application()

This is the file path of settings taken from pytonanywhere; /home/johnpearson81/comic_kollector_2/comic_kollector_2/settings.py

/home/johnpearson81/comic_kollector_2/comic_kollector_2/settings.py

I think it should be

os.environ['DJANGO_SETTINGS_MODULE'] = 'comic_kollector_2.settings'

and not

os.environ['DJANGO_SETTINGS_MODULE'] = 'comic_kollector_2.settings.py'