Forums

ModuleNotFoundError: No module named 'my-portfolio'?

I recently opened python anywhere account to host my website for free. For that, I read the docs in python anywhere, but I added the project name mistakenly in wsgi.py file. so, after all setup. I reloaded the site.I named the folder name as "my-portfolio". But it showed error " ModuleNotFoundError: No module named 'my-portfolio'". in error log. So I deleted the web app, deleted the files too and again clone the website from git and done with all the procedures noted in doc. This time, I renamed the folder name as "portfolio". After all configurations, I reloaded the site and, checked the errors log it again shows the same error " ModuleNotFoundError: No module named 'my-portfolio'". I don't know, Wsgi.py I changed, but it shows first-time wsgi.py file I wrote. So, wsgi.py file won't be deleted? or backed up first time and continue with this conf?. Please sort out this problem. Thanks in advance.

wsgi.py

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

To use your own django app use code like this:

import os import sys

assuming your django settings file is at '/home/Yabesh/mysite/mysite/settings.py'

and your manage.py is is at '/home/Yabesh/mysite/manage.py'

path = '/home/Yabesh/portfolio' if path not in sys.path: sys.path.append(path)

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

then:

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

Take a look at https://help.pythonanywhere.com/pages/DebuggingImportError/

how to delete the previous configuration of wsgi.py file.actually it is showing old conf, still? error shows like "my-portfolio". But i deleted those files and renamed as "portfolio"..How to solve this.? please help

Did you reload your web app after changing code?