Answer the question
In order to leave comments, you need to log in
How to solve problem with No module named 'django'?
After installing psycopg2, the following error appeared:
[Mon May 23 10:27:13.172654 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] mod_wsgi (pid=10094): Target WSGI script '/var/www/s052d78fe.fastvps-server.com/public_html/msite/msite/apache/wsgi.py' cannot be loaded as Python module.
[Mon May 23 10:27:13.172758 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] mod_wsgi (pid=10094): Exception occurred processing WSGI script '/var/www/s052d78fe.fastvps-server.com/public_html/msite/msite/apache/wsgi.py'.
[Mon May 23 10:27:13.172811 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] Traceback (most recent call last):
[Mon May 23 10:27:13.173027 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] File "/var/www/s052d78fe.fastvps-server.com/public_html/msite/msite/apache/wsgi.py", line 7, in <module>
[Mon May 23 10:27:13.173037 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] from django.core.wsgi import get_wsgi_application
[Mon May 23 10:27:13.173063 2016] [:error] [pid 10094:tid 140104487077632] [client 85.212.49.193:63426] ImportError: No module named 'django'
#wsgi.py
import os
import time
import traceback
import signal
import sys
from django.core.wsgi import get_wsgi_application
# Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append(project)
# Add the path to 3rd party django application and to django itself.
sys.path.append('/var/www/s052d78fe.fastvps-server.com/public_html/myv/lib/python3.4/site-packages')
os.environ['DJANGO_SETTINGS_MODULE'] = 'msite.apache.override'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Answer the question
In order to leave comments, you need to log in
what version of python is installed by default on the system? Execute in terminal "python"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question