Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - ImproperlyConfigured: Module "django.contrib.auth.middleware"

I'm running a virtualenv to try to learn Django, but for whatever reason after installing Django and when I try to access the default Django start page, I get the following error in the browser:

A server error occurred. Please contact the administrator.

In the terminal window where I am running the server says the following error:

ImproperlyConfigured: Module "django.contrib.auth.middleware" does not define a "SessionAuthenticationMiddleware" attribute/class

If anyone has any insight as to why I'm getting this error in the virtualenv, I'd appreciate it. I can get the server to run correctly in a non-virtualenv setup, though.

Here is the full stack trace:

Traceback (most recent call last):   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run     self.result = application(self.environ, self.start_response)   File "/Users/jruecke/Python/JSON/lib/python2.7/site-packages/Django-1.6.5-py2.7.egg/django/core/handlers/wsgi.py", line 187, in __call__     self.load_middleware()   File "/Users/jruecke/Python/JSON/lib/python2.7/site-packages/Django-1.6.5-py2.7.egg/django/core/handlers/base.py", line 45, in load_middleware     mw_class = import_by_path(middleware_path)   File "/Users/jruecke/Python/JSON/lib/python2.7/site-packages/Django-1.6.5-py2.7.egg/django/utils/module_loading.py", line 31, in import_by_path     error_prefix, module_path, class_name)) ImproperlyConfigured: Module "django.contrib.auth.middleware" does not define a "SessionAuthenticationMiddleware" attribute/class [16/Sep/2014 22:44:30] "GET / HTTP/1.1" 500 59 Traceback (most recent call last):   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run     self.result = application(self.environ, self.start_response)   File "/Users/jruecke/Python/JSON/lib/python2.7/site-packages/Django-1.6.5-py2.7.egg/django/core/handlers/wsgi.py", line 187, in __call__     self.load_middleware()   File "/Users/jruecke/Python/JSON/lib/python2.7/site-packages/Django-1.6.5-py2.7.egg/django/core/handlers/base.py", line 45, in load_middleware     mw_class = import_by_path(middleware_path)   File "/Users/jruecke/Python/JSON/lib/python2.7/site-packages/Django-1.6.5-py2.7.egg/django/utils/module_loading.py", line 31, in import_by_path     error_prefix, module_path, class_name)) ImproperlyConfigured: Module "django.contrib.auth.middleware" does not define a "SessionAuthenticationMiddleware" attribute/class 
like image 960
Jason Rueckert Avatar asked Sep 16 '14 23:09

Jason Rueckert


1 Answers

easy solution

just remove

'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 

from

MIDDLEWARE_CLASSES = ( ... ... ) 

in your project's settings.py

then, it should work!

like image 140
Shubham Badal Avatar answered Sep 29 '22 10:09

Shubham Badal