Forums

ImportError: No module named wsgi

#checked with--
#(django1.8)22:27 ~/StudyBook/StudyBook $ python /var/www/wsgi.py       
#output --                                                                                             
#python: can't open file '/var/www/wsgi.py': [Errno 2] No such file or directory
________________________________________________________________________
##getting same error when tried with django 1.6 and python 2.7.
##and here again with django 1.8 and python 2.7

wsgi file is configured as


import os

import sys

path = '/home/KBportal/Studybook'

if path not in sys.path:

    sys.path.append(path)

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "StudyBook.settings")

application = get_wsgi_application()

[edited by admin: formatting]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ note- it works fine on my windows and ubuntu , both systems

You said that you are trying to run python /var/www/wsgi.py and getting an error from it?