0
点赞
收藏
分享

微信扫一扫

【Vue+Django REST framework实战】第11章—— social_django集成第三方登录


social_django集成第三方登录-1


参考文档:

https://python-social-auth.readthedocs.io/en/latest/

github:

https://github.com/python-social-auth/social-app-django

settings配置文件:

INSTALLED_APPS = (
...
'social_django',
...
)


AUTHENTICATION_BACKENDS = (
'social_core.backends.open_id.OpenIdAuth',
'social_core.backends.google.GoogleOpenId',
'social_core.backends.google.GoogleOAuth2',
'social_core.backends.google.GoogleOAuth',
'social_core.backends.twitter.TwitterOAuth',
'social_core.backends.yahoo.YahooOpenId',
...
'django.contrib.auth.backends.ModelBackend',
)

TEMPLATES = [
{
...
'OPTIONS': {
...
'context_processors': [
...
'social_django.context_processors.backends',
'social_django.context_processors.login_redirect',
...
]
}
}
]

补充内容:

【Vue+Django REST framework实战】第11章—— social_django集成第三方登录_django

urlpatterns = patterns('',
...
url('', include('social_django.urls', namespace='social'))
...
)

访问:

127.0.0.1:8000/login/weibo


举报

相关推荐

0 条评论