Forums

ModuleNotFoundError: No module named 'apotheekMijlbeek_main'

Hey all,

I try to deploy my first Django / Postgres app on Pythonanywhere. I activated the postgres on my account / configured the port / address etc but when I try to run the code I'm getting the ModuleNotFoundError: No module named 'apotheekMijlbeek_main'. In my opinion my structure is like apotheekMijlbeek/apotheekMijlbeek_main and in this folder I'm having the settings.py

In the /var/www/stefrenneboog23_pythonanywhere_com_wsgi.py my code is like this :

# +++++++++++ DJANGO +++++++++++
# To use your own Django app use code like this:
import os
import sys

# assuming your Django settings file is at '/home/myusername/mysite/mysite/settings.py'
path = '/home/stefrenneboog23/apotheekMijlbeek'
if path not in sys.path:
    sys.path.insert(0, path)

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

## Uncomment the lines below depending on your Django version
###### then, for Django >=1.5:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
###### or, for older Django <=1.4
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHandler()

Really have no idea what I can change more. Thanks a lot already for the review. If needed you can have a look at my code :-) Thanks; Stef

This section of our help page https://help.pythonanywhere.com/pages/DebuggingImportError/#django-specific-issues show you how you can work out what you need to import in your wsgi file.