Home > OS >  Error running WSGI application, no module named django
Error running WSGI application, no module named django

Time:03-29

I have some problem while deploying my website to Pythonanywhere.com

i've done all things step by step like it was in a guide-line and at the end i catch an error:

error log

2022-03-27 20:07:23,699: Error running WSGI application 2022-03-27
20:07:23,700: ModuleNotFoundError: No module named 'django' 2022-03-27 
20:07:23,700:   File "/var/www/usitingshit_pythonanywhere_com_wsgi.py",
line 88, in <module> 2022-03-27 20:07:23,700:     from django.core.wsgi
import get_wsgi_application 2022-03-27 20:07:23,700: 

i've tried to change wsgi.py file

import os
import sys

path = '/home/usitingshit/deploy_course_work/'
if path not in sys.path:
  sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] ='/home/usitingshit/deploy_course_work/vodprojectstroy_site/wsgi.py'

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

structure of my project: enter image description here enter image description here

has anybody had the same problem? how can i fix that? sorry if this question is silly, coz i am a beginner in django

CodePudding user response:

Django is preinstalled on PythonAnywhere, so it's basically available out of the box. However, if you want to use a virtual environment for the web app, you need to ensure that Django is available in it too. The error you're seeing is most probably indicating that you set a virtual environment for the web app, but did not install Django in it.

  • Related