getting this error when making website live. When
path set in wsgi
WSGIDaemonProcess demo python-path=/root/election python-home=/root/venv
WSGIProcessGroup demo
WSGIScriptAlias / /root/election/election/wsgi.py
this is error from my logs
mod_wsgi (pid=*): Target WSGI script '/root/election/election/wsgi.py' cannot be loaded as Python m$[time] [wsgi:error] [pid 17712:tid 140454280738560] [remote 43.241.144.192:527] mod_wsgi (pid=*): Exception occurred processing WSGI script '/root/election/election/wsgi.py'.
Traceback (most recent call last):
File "/root/election/election/wsgi.py", line 12, in <module>
from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django'
I verified that path is correctly specified that is as below
path to wsgi
/root/election/election/wsgi.py
virtual env path
/root/venv
tried reinstalling wsgi by below command. but still error not solved
$ sudo apt-get remove libapache2-mod-python libapache2-mod-wsgi
$ sudo apt-get install libapache2-mod-wsgi-py3
I even given persmission of 777 to my project directory and virtualevn still geting this error
output of these command ask other peoples so. It is as below.
>>> django.__file__
'/root/venv/lib/python3.8/site-packages/django/__init__.py'
>>> import sys
>>> sys.prefix
'/root/venv'
followed this and googled other answers but although this question asked many time and duplicated but still it is is not answerd.
question from:
https://stackoverflow.com/questions/65623036/mod-wsgi-pid-target-wsgi-script-root-project-wsgi-py-cannot-be-loaded-as 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…