禁止访问 (403)

CSRF验证失败. 请求被中断.
Help

Reason given for failure:

CSRF token missing or incorrect.

In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism has not been used correctly. For POST forms, you need to ensure:

Your browser is accepting cookies.
    The view function passes a request to the template's render method.
    In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
    If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
    The form has a valid CSRF token. After logging in in another browser tab or hitting the back button after a login, you may need to reload the page with the form, because the token is rotated after a login.

You're seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.

You can customize this page using the CSRF_FAILURE_VIEW setting

解决方案:

注释掉下面部分

# AUTH_PASSWORD_VALIDATORS = [
#     {
#         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
#     },
#     {
#         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
#     },
#     {
#         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
#     },
#     {
#         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
#     },
# ]

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'allauth.account.auth_backends.AuthenticationBackend',
)

在admin设置第三方帐号登录点击Save保存按钮的时候报错     CSRF token missing or incorrect.相关推荐

  1. [bhpyg] QQ互联接口 ,第三方帐号登录

    1.介绍 现在很多网站都集成了第三方帐号登录的功能,比如QQ登录.微信登录.微博登录. 使用第三方帐号登录目的,简化用户注册的流程,实现快速的注册登录. 第三方登录基本流程:①跳转到第三方认证页面 ② ...

  2. php curl登录,php curl实现第三方帐号登录

    今天帮学院写了个小网站,根据要求要用数字沈航帐号登录,还没办法与数字沈航的工作人员交流,无奈想出了个使用curl这个解决方案. 数字沈航(http://i.sau.edu.cn)是我们学校全部数字服务 ...

  3. 使用Google帐号登录Android应用

    需求 对于一个应用来说,帐号管理真是一件麻烦事,所以通过OAuth之类的使用第三方帐号登录是常见的做法.关于这个实现,在Web端有很多现成的解决方案.我之前发过的<RESTful客户端库:Res ...

  4. 传奇怎么设置GM帐号GM命令

    传奇怎么设置GM帐号GM命令 我们先创建账号进入游戏 进入到服务器里面打开我的电脑 计算机D:\Mirserver\Mir200\Envir打开AdminList.txt文件 退出保存文本,小退一下游 ...

  5. java session 数量_java中使用session监听实现同帐号登录限制、登录人数限制

    本文主要介绍了java中使用session监听实现同帐号登录限制.登录人数限制,具体代码如下: 问题域: 1.同帐号登录:若此帐号已登录,不可再次登录(与QQ模式相反). 2.登录人数限制,超过.已达 ...

  6. apple帐号登录服务器端接入

    新博客地址(shankusu.me) 原文转载自 http://cwqqq.com/2020/09/27/apple_login_api_server_side apple帐号登录服务器端接入 最近有 ...

  7. [转]帐号登录事件(事件编号与描述)

    帐号登录事件(事件编号与描述) 作者:独孤行@winmag 来源:http://www.feelids.com/bbs/ 672 身份验证服务(AS)票证得到成功发行与验证. 673 票证授权服务(T ...

  8. Outlook2007设置POP3帐号

    Outlook2007设置POP3帐号 提示:本说明中所使用的版本为Microsoft Office Outlook 2007简体中文版,并以me@mycompany.com.cn 做为企业邮箱地址, ...

  9. qwidget多个窗口同步_【好人BUG】本机多组控制 一台电脑使用一个帐号登录多个(省钱) !...

    一台电脑,可以用同一个好人帐号登录N个,达到控制一台电脑分组控制多个窗口同步操作. 这个好人BUG,你是否知道!给你省钱-->--> --------------------------- ...

最新文章

  1. 在python中使用关键字define定义函数_python自定义函数def的应用详解
  2. sklearn使用投票回归VotingRegressor算法构建多模型融合的投票回归模型、并自定义子回归器的权重(weights)、评估多模型融合的回归模型、评估R2、mse、rmse、mape
  3. Android之在Layout中自定义View
  4. [ACM] hdu 1228 A+B (字符串处理)
  5. mySql完全手册2011031401
  6. HTML基础_Day01
  7. 3.1.6 OS之分页存储(页号、页偏移量等)
  8. 巴比伦算法求平方根c语言,巴比伦算法求平方根
  9. c 调用openoffice word转pdf_批量 Word 转 PDF 方法
  10. centos java mvn_Linux(centos7)安装JDK1.8与maven
  11. 通用模块 -- Dubbo 用户模块
  12. jackson java反序列化_使用Jackson JSON映射器序列化/反序列化java 8 java.time
  13. python下载大文件mp4_python 实现视频流下载保存MP4的方法
  14. [Android Pro] RecyclerView实现瀑布流效果(二)
  15. android网页去广告插件下载,Adblock Plus(去广告插件)APP增强稳定版
  16. 互动媒体技术专题2——多视角认识十二个“一” 技术预演与方案设计
  17. 重心(质量对位置的加权平均)与转动惯量(使物体甩动的难易程度与质量m和到轴的距离r的平方有关)
  18. 9011,9012,9013,9014,8050,8550 三极管的区别
  19. 离散数学自反,对称,传递闭包
  20. android 添加蒙版实现护眼模式(夜间模式)

热门文章

  1. [ An Ac a Day ^_^ ] CodeForces 691F Couple Cover 花式暴力
  2. NOIP2009普及组细胞分裂(数论)——yhx
  3. LeetCode198——house robber(不懂dp)
  4. win8.1和wp8.1共用代码,需要注意的一些问题
  5. 使用笛卡尔积 cross join解决傻傻的问题
  6. 崛起吧,亲爱的,该背单词了!!!
  7. echarts 环形图 默认高亮展示某个数据
  8. 微服务架构 接口交互问题_架构师的故事:设计微服务架构
  9. vue组件的实例使用
  10. echarts图表大小随着外部div大小变化