搞第三方授权登录的时候

完整报错如下:

DoesNotExist at /accounts/github/login/

SocialApp matching query does not exist.
Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/github/login/?process=login
Django Version: 2.2.10
Exception Type: DoesNotExist
Exception Value:
SocialApp matching query does not exist.
Exception Location: /home/appleyuchi/.virtualenvs/python3.7/lib/python3.7/site-packages/django/db/models/query.py in get, line 408
Python Executable: /home/appleyuchi/.virtualenvs/python3.7/bin/python
Python Version: 3.7.5
Python Path:
['/home/appleyuchi/桌面/RawStone/django-allauth的调研-☆☆☆☆/Django搭建个人博客:用django-allauth实现第三方登录/my_blog','/home/appleyuchi/.virtualenvs/python3.7/lib/python37.zip','/home/appleyuchi/.virtualenvs/python3.7/lib/python3.7','/home/appleyuchi/.virtualenvs/python3.7/lib/python3.7/lib-dynload','/usr/lib/python3.7','/home/appleyuchi/.virtualenvs/python3.7/lib/python3.7/site-packages','/home/appleyuchi/桌面/原始的Django-oscar/django-oscar/src','/home/appleyuchi/桌面/原始的Django-oscar/django-oscar-paypal']
Server time: Sun, 1 Mar 2020 04:44:56 +0000

先说下Django中SITE_ID的意思,其实是admin里面的站点的第几个,

默认情况下SITE_ID=1

建议删除http://127.0.0.1:8000/admin/界面中没用的SITE,留一个就行了,如果多个SITE都有用,那么

在settings.py中修改SITE_ID的取值即可

不确定SITE_ID的取值的情况下,可以使用:

python manage.py shell
from django.contrib.sites.models import Site
print(Site.objects.get(name='example.com').id)

解决方案,检查3个东西:

①settings.py中的SITE_ID的数值以及INSTALLED_APPS中的

'allauth.socialaccount.providers.github',

②检查站点名称

③增加共享登录

http://127.0.0.1:8000/admin/socialaccount/socialapp/add/

Django报错SocialApp matching query does not exist以及Django的SITE_ID = 1的含义相关推荐

  1. Person matching query does not exist;Django增删改查异常

    1.数据库在删除或修改时常出现Person matching query does not exist的错误,是因为在链接路由是忘记传参,一般是忘记传id参数. 错误代码 <td>< ...

  2. SAP MM ML81N为采购订单创建服务接收单,报错- No matching PO items selected -

    SAP MM ML81N为采购订单创建服务接收单,报错- No matching PO items selected - SAP里的服务采购流程跟有形的实物采购流程并不相同.除了在采购单据上的差异以外 ...

  3. Django入门:DoesNotExist: User matching query does not exist.

    前言 博主最近在用django假设网络服务,遇到了一些问题,特此记录一下. 目录 文章目录 前言 目录 正文 解决方案 TIPS 正文 问题描述如下: D:\Anaconda\envs\exam2\S ...

  4. Django报错 ValueError: The view didn‘t return an HttpResponse object. It returned None instead.

    Django报错 ValueError: The view *** didn't return an HttpResponse object. It returned None instead. __ ...

  5. xshell4连接ubuntu,报错No matching outgoing encryption

    xshell4连接ubuntu系统,报错No matching outgoing encryption,没有匹配的算法. xshell4连接centos.redhat没有问题.于是怀疑是不是远程连接工 ...

  6. scp或者ssh报错“no matching host key type found. Their offer: ssh-rsa,ssh-dss“

    scp或者ssh报错"no matching host key type found. Their offer: ssh-rsa,ssh-dss" 原因:OpenSSH 7.0以后 ...

  7. django报错: Specifying a namespace in include() without providing an app_name

    django报错: 'Specifying a namespace in include() without providing an app_name ' django.core.exception ...

  8. django之异常错误3(Student matching query does not exist.)

    django之异常错误3(Student matching query does not exist.) 参考文章: (1)django之异常错误3(Student matching query do ...

  9. Django报错:“Key ‘id‘ not found in ‘xxx‘

    Django报错:"Key 'id' not found in 'xxx' 在写django的时候发现了这个错误,id一开始一脸懵逼,id字段不可能不存在啊... 查了一下发现问题在admi ...

最新文章

  1. django 完整日志配置
  2. 05-数据类型、常量、变量
  3. 《NLTK基础教程——用NLTK和Python库构建机器学习应用》——2.3 语句分离器
  4. 计算机2018创业方向,推荐2018年创业的方向
  5. Hadoop webHDFS设置和使用说明
  6. C++中 return,break,continue的用法
  7. spark生态及各个功能
  8. 凯撒密码及C语言python实现
  9. dex2jar java 1.8_dex2jar v2.1 最新版本打包
  10. FFmpeg进阶:给视频添加文字水印
  11. commit节点号 git_Git调整commit之间顺序
  12. 虚拟机无法连接虚拟设备sata0:1
  13. 2022年10月17日【Jiawei_Z】WPF的容器章节
  14. 如何让区块链获得人工智能的能力
  15. php mysql抽奖转盘_PHP微信转盘抽奖前后台 数据库完整示例
  16. 【kimol君的无聊小发明】—用python写论文下载器(图形化界面)
  17. 红队 入门_我穿越网络安全红队的硕士证书的旅程
  18. 使用Vue表单时输入框无法输入文字
  19. 卷积层和全连接层的区别_CNN卷积层、全连接层的参数量、计算量
  20. java php 时间戳转日期_java时间戳转php时间戳

热门文章

  1. 关于MySQL相关的查看显示信息:
  2. matlab 读写其他格式数据文件(excel)
  3. C#编写的windows程序随系统启动
  4. 从实验现象详细分析BGP的路由策略与选路原则
  5. SQL2005 数据库数据同步
  6. java xwork_java-与休眠的Struts2 xwork类型转换
  7. 四象限法推导lm曲线_IS曲线推导
  8. iview中时间选择器可设置选择范围方法(一个月 一周等)
  9. springboot 返回字符串带引号_SpringBoot-基础
  10. HTML基础(我的复习和学习过程)day-01