关于python 的django-forbidden-csrf-cookie-not-set问题

报错时也会出现如下提示: CSRF cookie not set.

到setting里面注释掉下面的注释位置就好、

例如:

MIDDLEWARE = [

    ‘django.middleware.security.SecurityMiddleware’,

    ‘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’,

]

    原文作者: 汉诺塔问题
    原文地址: https://blog.csdn.net/shunzi2016/article/details/60956493
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞