gpt4 book ai didi

python - 在 Python Social Auth 中添加新后端

转载 作者:行者123 更新时间:2023-12-01 03:16:05 25 4
gpt4 key购买 nike

python-social auth 的文档描述了如何添加身份验证后端,但没有说明将新后端的 CLIENT_IDCLIENT_SECRET 放在哪里。

以下是相关文档:http://python-social-auth.readthedocs.io/en/latest/backends/implementation.html#oauth

最佳答案

我是这样实现的:

from django.conf import settings

class CustomOAuth2(BaseOAuth2):
name = 'custom'

def get_key_and_secret(self):
return settings.CUSTOM_OAUTH_CLIENT_ID, settings.CUSTOM_OAUTH_CLIENT_SECRET

关于python - 在 Python Social Auth 中添加新后端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42457619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com