I don't have this problem on my local development environment, but I just deployed the app with nginx + gunicorn (first time deploying an app) and I am getting this traceback whenever I try to make a request.
2012-01-21 22:24:36 [5712] [ERROR] Error handling request
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/gunicorn/workers/sync.py", line 96, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 219, in __call__
self.load_middleware()
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 51, in load_middleware
raise exceptions.ImproperlyConfigured('Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname))
ImproperlyConfigured: Middleware module "django.middleware.csrf" does not define a "CsrfResponseMiddleware" class
The following is a part of my settings.py file
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
Anyone can point me in the right direction?
Looks like the server where you deployed has different version of Django (old one). Also Penthi is right, CsrfResponseMiddleware
is for backward compatibility and should be removed. https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#legacy-method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With