我应该怎么做才能使管理服务在 Django 1.2 中工作
以前效果很好。
现在,当我尝试访问 /admin/ 时,我遇到了一个错误:
Module "django.contrib.auth.context_processors" does not define a "csrf" callable request processor
我读到了: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/
现在我的设置是:
MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
)
我必须做什么才能使其工作?
It worked great before.
And now when I'm trying to go to /admin/ I have a mistake:
Module "django.contrib.auth.context_processors" does not define a "csrf" callable request processor
I read this: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/
Now in my settings are:
MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
)
What I have to do to make it work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了使它工作,我必须以不同的顺序编写它:
To make it work I had to write it in different order: