Oh man! I spent a couple of hours on this. Absolutely ridiculous! Here is 
what it fixed for my mezzanine's project:

# Remove any references to your home folder (this can break Mezzanine)
while "." in sys.path:
    sys.path.remove(".")
while "" in sys.path:
    sys.path.remove("")

I am writing a post on this. I was following a tutorial and got stuck on 
this WSGI issue.


On Monday, May 25, 2015 at 1:54:54 PM UTC-5, Robert librado wrote:
>
> 939 :Traceback (most recent call last):
> 2015-05-25 18:45:19,939 :  File "/bin/user_wsgi_wrapper.py", line 130, in 
> __call__
> 2015-05-25 18:45:19,939 :    self.error_log_file.logger.exception("Error 
> running WSGI application")
> 2015-05-25 18:45:19,939 :  File "/usr/lib/python2.7/logging/__init__.py", 
> line 1185, in exception
> 2015-05-25 18:45:19,940 :    self.error(msg, *args, **kwargs)
> 2015-05-25 18:45:19,940 :  File "/usr/lib/python2.7/logging/__init__.py", 
> line 1178, in error
> 2015-05-25 18:45:19,940 :    self._log(ERROR, msg, args, **kwargs)
> 2015-05-25 18:45:19,940 :  File "/usr/lib/python2.7/logging/__init__.py", 
> line 1270, in _log
> 2015-05-25 18:45:19,940 :    record = self.makeRecord(self.name, level, fn, 
> lno, msg, args, exc_info, func, extra)
> 2015-05-25 18:45:19,940 :  File "/usr/lib/python2.7/logging/__init__.py", 
> line 1244, in makeRecord
> 2015-05-25 18:45:19,941 :    rv = LogRecord(name, level, fn, lno, msg, args, 
> exc_info, func)
> 2015-05-25 18:45:19,941 :  File "/usr/lib/python2.7/logging/__init__.py", 
> line 284, in __init__
> 2015-05-25 18:45:19,941 :    self.threadName = threading.current_thread().name
> 2015-05-25 18:45:19,941 :  File "/usr/lib/python2.7/threading.py", line 1160, 
> in currentThread
> 2015-05-25 18:45:19,941 :    return _active[_get_ident()]
> 2015-05-25 18:45:19,941 :  File "/bin/user_wsgi_wrapper.py", line 122, in 
> __call__
> 2015-05-25 18:45:19,941 :    app_iterator = self.app(environ, start_response)
> 2015-05-25 18:45:19,941 :  File 
> "/home/pycharm/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py",
>  line 168, in __call__
> 2015-05-25 18:45:19,942 :    self.load_middleware()
> 2015-05-25 18:45:19,942 :  File 
> "/home/pycharm/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/handlers/base.py",
>  line 44, in load_middleware
> 2015-05-25 18:45:19,942 :    mw_class = import_string(middleware_path)
> 2015-05-25 18:45:19,942 :  File 
> "/home/pycharm/.virtualenvs/django17/local/lib/python2.7/site-packages/django/utils/module_loading.py",
>  line 26, in import_string
> 2015-05-25 18:45:19,943 :    module = import_module(module_path)
> 2015-05-25 18:45:19,943 :  File "/usr/lib/python2.7/importlib/__init__.py", 
> line 37, in import_module
> 2015-05-25 18:45:19,943 :    __import__(name)
> 2015-05-25 18:45:19,943 :ImportError: No module named security
>
>
>
>
> heres the code:
>
>
>
> import os
> import sys
>
> # assuming your django settings file is at 
> '/home/MYUSERNAME/MYSITE/settings.py'
> path = '/home/pycharm/work'
> if path not in sys.path:
>     sys.path.append(path)
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'work.settings'
> from django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a313bd0b-85d5-4167-b81a-e372b76158a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to