Forums

Error running WSGI application ModuleNotFoundError: No module named 'myprojectname'

The defaualt wspi.py file in python anywhere states:

# assuming your django settings file is at '/home/appman/mysite/mysite/settings.py'
# and your manage.py is is at '/home/appman/mysite/manage.py'
# path = '/home/appman/mysite'

Well, I don't have a settings.py. My project name is config and the config folder has a settings folder and inside the settings folder is init.py, base.py, dev.py and prod.py.

Also, my manage.py is not in my project folder config. It is in the main folder mitch-business-apps.

I tried a lot of combinations to get my app to load as a web page on python anywhere to no avail.

For example I tried:

path = '/home/appman/mitch-business-apps/config'
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings.prod' (also tried config.settings.dev)

So my setup is different than the assumptions of python anywhere. Please let me know how to setup the path and os.environ['DJANGO_SETTINGS_MODULE'] so my app will work on python anywhere.

Try:

path = '/home/appman/mitch-business-apps
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings.prod'

and reload the web app.

I tried your suggestions and I'm still get the same error:

Error running WSGI application ModuleNotFoundError: No module named 'config'

Please advise.

Are you sure you're looking at the right part of the error logs? The most recent error is at the bottom of the file, and when I look at the logs available from our admin interface, it looks like you're getting a syntax error in your settings file.

Hello, I don't have a settings file in my project on github. I have a settings folder. Attached shows the file structure in my project.

Please advise.

settings image

OK, but again, look at the last error in the error log. It's telling you exactly what the problem is.