Coder Social home page Coder Social logo

Comments (3)

Hopetree avatar Hopetree commented on September 26, 2024

@qiutzh 你说的是我的网站还是你用我代码部署的?如果是我的网站应该不存在这个问题,而且这两个方式也不是注册,而是登录。

如果你部署的,那么你需要进入管理界面,添加github和微博的接口,具体是在后台的Social applications中添加,这个你可以查一下django-allauth的用法

from izone.

qiutzh avatar qiutzh commented on September 26, 2024

哦,多谢大佬,我是利用代码部署的哈。

from izone.

qiutzh avatar qiutzh commented on September 26, 2024

@Hopetree 博主帮我看下,我这样配置的github第三方登录问题出在哪了呢?

settings.py

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'

urls.py

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登录上面的错误还存在--__--

from izone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.