Closed qiutzh closed 3 years ago
@qiutzh 你说的是我的网站还是你用我代码部署的?如果是我的网站应该不存在这个问题,而且这两个方式也不是注册,而是登录。
如果你部署的,那么你需要进入管理界面,添加github和微博的接口,具体是在后台的Social applications中添加,这个你可以查一下django-allauth的用法
哦,多谢大佬,我是利用代码部署的哈。
@Hopetree 博主帮我看下,我这样配置的github第三方登录问题出在哪了呢?
AUTHENTICATION_BACKENDS = {
...
'social_core.backends.github.GithubOAuth2',
}
INSTALLED_APPS = [
...
'social_django',
]
TEMPLATES = [
...
'social_django.context_processors.backends',
'social_django.context_processors.login_redirect',
]
SOCIAL_AUTH_GITHUB_KEY = 'xxx'
SOCIAL_AUTH_GITHUB_SECRET = 'xxxxxx'
urlpatterns = [
...
path('accounts/github/login/', auth_views.LoginView.as_view(), name='login'),
path('accounts/github/login/callback/', include('social_django.urls', namespace='social')),
]
做了以上这些配置后,然后启动web服务,点击选择github方式登录,还是报了错
Internal Server Error: /accounts/github/login/
allauth.socialaccount.models.SocialApp.DoesNotExist: SocialApp matching query does not exist.
后面我登录到后台,把github的Client id和Secret key填上,添加sites站点后,再次启动点击github登录上面的错误还存在--__--
@Hopetree 博主您好,如题,我在选择微博注册或者Github注册时,页面有以下错误提示:
请问怎么解决呢?感谢!