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

查看完整文章