Django - 500 Internal Server Error "no Module Named Django"
django return 500 internal server error (apache 2.4.10, ubuntu 15.04, django 1.9.6) apache log: [wsgi:warn] mod_wsgi: Compiled for Python/3.4.2. [wsgi:warn] mod_wsgi: Runtime using
Solution 1:
It seems like you are missing django. This error is returned by wsgi not django. You can check using pip freeze
. Make sure django is listed in the output of pip freeze. Else install django with pip using command
pip install django
It is always recommended to use virtual environment
to avoid messing up with global dependencies. If working in a virtual environment does not create any problems for you, then go for virtual environment.
Solution 2:
In my guess, adding path to wsgi.py may help:
import os
import sys
from django.core.wsgi import get_wsgi_application
path = '/path/to/your/project'ifpathnotin sys.path:
sys.path.append(path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
application = get_wsgi_application()
Post a Comment for "Django - 500 Internal Server Error "no Module Named Django""