ImproperlyConfigured: Middleware module “django.middleware.csrf” does not define a “CsrfResponseMiddleware” class

后端 未结 3 1252
庸人自扰
庸人自扰 2021-01-13 13:42

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 traceba

3条回答
  •  长发绾君心
    2021-01-13 13:56

    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.

提交回复
热议问题