django升级到1.2.1之后,如果post时候引起csrf verification failed.错误的话,需要更改settings.py中My MIDDLEWARE_CLASSES字段。修改方法如下:

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',
)

发表评论

电子邮件地址不会被公开。 必填项已用*标注