0

我让我的网站在 django 本地环境中运行,它运行良好....但由于某些原因,我使用了来自另一个本地主机系统的 localsettings.py 文件运行同一网站...它开始给我 505 错误...当我追溯了......以下事情开始出现......

 Traceback (most recent call last):
      File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
        self.result = application(self.environ, self.start_response)
      File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
        return self.application(environ, start_response)
      File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 219, in __call__
        self.load_middleware()
      File "/usr/local/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
    [05/Sep/2012 15:33:35] "GET / HTTP/1.1" 500 59

任何帮助都会有所帮助

4

1 回答 1

0

CsrfResponseMiddleware在 Django 1.4 中被删除。您可能在一个环境中运行 Django 1.2-1.3,而在另一个环境中运行 Django 1.4-master。

于 2012-09-05T15:11:28.263 回答