Forums

Module not found errors

Hello,

I'm having two issues. The first one is that when I try to run my app I get the following error

ModuleNotFoundError: No module named 'NWF.settings'

I went through the debugging checklist and as far as I can tell I am pointing it at the right folder. My manage.py file is at home/johnabobst/NWF and my settings file is at home/johnabobst/NWF/NWF.

Here are the contents of my /var/www/johnabobst_pythonanywhere_com_wsgi.py file

import os
import sys

path = '/home/johnabobst/NWF'
if path not in sys.path:
    sys.path.append(path)

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


from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

My second issue came while trying to debug the first issue. I tried to run the shell, to see if I could import settings.py from there. But when I run the command 'python manage.py shell' I get the following error.

ModuleNotFoundError: No module named 'django.contrib.admin'

Since they're both issues with finding modules I'm assuming their related somehow, but I have no idea how. Any help is greatly appreciated. Thanks!

I figured it out. It was an issue with my virtual environment. I didn't create it in the right directory.

Great! Glad you worked it out.