Django报错SocialApp matching query does not exist以及Django的SITE_ID = 1的含义
搞第三方授权登录的时候
完整报错如下:
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: |
|
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: |
|
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的含义相关推荐
- Person matching query does not exist;Django增删改查异常
1.数据库在删除或修改时常出现Person matching query does not exist的错误,是因为在链接路由是忘记传参,一般是忘记传id参数. 错误代码 <td>< ...
- SAP MM ML81N为采购订单创建服务接收单,报错- No matching PO items selected -
SAP MM ML81N为采购订单创建服务接收单,报错- No matching PO items selected - SAP里的服务采购流程跟有形的实物采购流程并不相同.除了在采购单据上的差异以外 ...
- Django入门:DoesNotExist: User matching query does not exist.
前言 博主最近在用django假设网络服务,遇到了一些问题,特此记录一下. 目录 文章目录 前言 目录 正文 解决方案 TIPS 正文 问题描述如下: D:\Anaconda\envs\exam2\S ...
- 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. __ ...
- xshell4连接ubuntu,报错No matching outgoing encryption
xshell4连接ubuntu系统,报错No matching outgoing encryption,没有匹配的算法. xshell4连接centos.redhat没有问题.于是怀疑是不是远程连接工 ...
- 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以后 ...
- 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 ...
- django之异常错误3(Student matching query does not exist.)
django之异常错误3(Student matching query does not exist.) 参考文章: (1)django之异常错误3(Student matching query do ...
- Django报错:“Key ‘id‘ not found in ‘xxx‘
Django报错:"Key 'id' not found in 'xxx' 在写django的时候发现了这个错误,id一开始一脸懵逼,id字段不可能不存在啊... 查了一下发现问题在admi ...
最新文章
- django 完整日志配置
- 05-数据类型、常量、变量
- 《NLTK基础教程——用NLTK和Python库构建机器学习应用》——2.3 语句分离器
- 计算机2018创业方向,推荐2018年创业的方向
- Hadoop webHDFS设置和使用说明
- C++中 return,break,continue的用法
- spark生态及各个功能
- 凯撒密码及C语言python实现
- dex2jar java 1.8_dex2jar v2.1 最新版本打包
- FFmpeg进阶:给视频添加文字水印
- commit节点号 git_Git调整commit之间顺序
- 虚拟机无法连接虚拟设备sata0:1
- 2022年10月17日【Jiawei_Z】WPF的容器章节
- 如何让区块链获得人工智能的能力
- php mysql抽奖转盘_PHP微信转盘抽奖前后台 数据库完整示例
- 【kimol君的无聊小发明】—用python写论文下载器(图形化界面)
- 红队 入门_我穿越网络安全红队的硕士证书的旅程
- 使用Vue表单时输入框无法输入文字
- 卷积层和全连接层的区别_CNN卷积层、全连接层的参数量、计算量
- java php 时间戳转日期_java时间戳转php时间戳