Forums

Strange ImproperlyConfiguredError when reloading an app?

I restarted my web app today and got this error message and i can't figure out what is the problem:

2013-12-23 18:31:40,286 :Traceback (most recent call last):
2013-12-23 18:31:40,286 :  File "/bin/user_wsgi_wrapper.py", line 67, in __call__
2013-12-23 18:31:40,287 :    self.error_log_file.logger.exception("Error running WSGI application")
2013-12-23 18:31:40,287 :  File "/usr/lib/python2.7/logging/__init__.py", line 1183, in exception
2013-12-23 18:31:40,287 :    self.error(msg, *args, **kwargs)
2013-12-23 18:31:40,287 :  File "/usr/lib/python2.7/logging/__init__.py", line 1176, in error
2013-12-23 18:31:40,287 :    self._log(ERROR, msg, args, **kwargs)
2013-12-23 18:31:40,288 :  File "/usr/lib/python2.7/logging/__init__.py", line 1268, in _log
2013-12-23 18:31:40,288 :    record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
2013-12-23 18:31:40,288 :  File "/usr/lib/python2.7/logging/__init__.py", line 1242, in makeRecord
2013-12-23 18:31:40,288 :    rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
2013-12-23 18:31:40,288 :  File "/usr/lib/python2.7/logging/__init__.py", line 284, in __init__
2013-12-23 18:31:40,288 :    self.threadName = threading.current_thread().name
2013-12-23 18:31:40,289 :  File "/usr/lib/python2.7/threading.py", line 1158, in currentThread
2013-12-23 18:31:40,289 :    return _active[_get_ident()]
2013-12-23 18:31:40,289 :  File "/bin/user_wsgi_wrapper.py", line 59, in __call__
2013-12-23 18:31:40,289 :    app_iterator = self.app(environ, start_response)
2013-12-23 18:31:40,289 :  File "/home/dhirajthakur/env/ve/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
2013-12-23 18:31:40,292 :    self.load_middleware()
2013-12-23 18:31:40,292 :  File "/home/dhirajthakur/env/ve/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
2013-12-23 18:31:40,293 :    raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
2013-12-23 18:31:40,293 :django.core.exceptions.ImproperlyConfigured: Error importing middleware django.midggdleware.csrf: "No module named midggdleware.csrf"

How can i resolve this?

It looks like there's a typo in your settings.py -- it's complaining that it can't import django.midggdleware.csrf, which should probably be django.middleware.csrf. If you edit your settings.py and correct the typo, then reload the app, it should work.

Thank you! :)