0
使用django-allauth通過Stripe Connect對用戶進行身份驗證。似乎連接條帶化和允許登錄,但是當回到我的網站,它呈現的allauth錯誤模板,說:django-allauth重定向url使用Stripe OAuth說「登錄失敗」
An error occurred while attempting to login via your social network account.
任何想法對我做了什麼錯在這裏?
這是我所做的。
settings.py
INSTALLED_APPS = [
...
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.stripe',
...
]
AUTHENTICATION_BACKENDS = [
...
'allauth.account.auth_backends.AuthenticationBackend',
...
]
SITE_ID = 1
urls.py
urlpatterns = [
...
url(r'^accounts/', include('allauth.urls')),
...
]
的login.html
{% if user and not.is_anonymous %}
<h2>Hello, {{ user.get_full_name }}.</h2>
{% else %}
<p><a href="{% provider_login_url 'stripe' %}" class="btn btn-default">Stripe</a></p>
{% endif %}
條紋連接
Website URL: https://127.0.0.1:8000
Redirect_URIs: http://127.0.0.1:8000/accounts/stripe/login/callback/
在django管理員中設置社交應用程序,如下所示:
Social Applications = http://127.0.0.1:8000/
也許你錯過了一些與standelone連接。再次查看https://stripe.com/docs/connect/standalone-accounts – rakwen