Forums

ImportError: Could not import settings

2015-04-22 05:29:39,733 :Traceback (most recent call last): 2015-04-22 05:29:39,733 : File "/bin/user_wsgi_wrapper.py", line 130, in call 2015-04-22 05:29:39,734 : self.error_log_file.logger.exception("Error running WSGI application") 2015-04-22 05:29:39,734 : File "/usr/lib/python2.7/logging/init.py", line 1185, in exception 2015-04-22 05:29:39,734 : self.error(msg, args, kwargs) 2015-04-22 05:29:39,734 : File "/usr/lib/python2.7/logging/init.py", line 1178, in error 2015-04-22 05:29:39,735 : self._log(ERROR, msg, args, *kwargs) 2015-04-22 05:29:39,735 : File "/usr/lib/python2.7/logging/init.py", line 1270, in _log 2015-04-22 05:29:39,735 : record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra) 2015-04-22 05:29:39,735 : File "/usr/lib/python2.7/logging/init.py", line 1244, in makeRecord 2015-04-22 05:29:39,735 : rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func) 2015-04-22 05:29:39,735 : File "/usr/lib/python2.7/logging/init.py", line 284, in init 2015-04-22 05:29:39,736 : self.threadName = threading.current_thread().name 2015-04-22 05:29:39,736 : File "/usr/lib/python2.7/threading.py", line 1160, in currentThread 2015-04-22 05:29:39,736 : return _active[_get_ident()] 2015-04-22 05:29:39,736 : File "/bin/user_wsgi_wrapper.py", line 122, in call 2015-04-22 05:29:39,736 : app_iterator = self.app(environ, start_response) 2015-04-22 05:29:39,736 : File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application 2015-04-22 05:29:39,736 : raise e 2015-04-22 05:29:39,736 :ImportError: Could not import settings 'libertyEvents.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named libertyEvents.settings

1.created virtualenv

with python version 2.7 django version 1.7

  1. .installed mysql-python in virtual env
  2. changed wsgi

    var > www > sudhinthedeveloper_pythonanywhere_com_wsgi.py
    to

                         # +++++++++++ CUSTOM WSGI +++++++++++
        # If you have a WSGI file that you want to serve using PythonAnywhere, perhaps
        # in your home directory under version control, then use something like this:
        #
        import os
        import sys
    
        path = '/home/sudhinthedeveloper/libertyEvents/libertyEvents/'
       if path not in sys.path:
           sys.path.append(path)
       from wsgi import application
    

i am tired...

i found myself. just changed my wsgi file to

import os
import sys
path = '/home/sudhinthedeveloper/libertyEvents'
if path not in sys.path:
    sys.path.append(path)


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

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
             / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\    
<<<<<<:>~  <   Yay!          |   
             \_________/