CSRF verification failed. Request aborted.

解决办法:

将settings.py中的红色这一行注释

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    #'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

 

posted on 2018-05-13 21:55    阅读(193)  评论(0编辑  收藏  举报