Python 重定向到?next=/accounts/social/connections/在django allauth中

Python 重定向到?next=/accounts/social/connections/在django allauth中,python,django,url-redirection,django-allauth,Python,Django,Url Redirection,Django Allauth,我试图在/account/profile处重定向,但在使用django allauth时,我在?next=/accounts/social/connections/处被重定向 有什么想法吗?我的设置.py我已设置 LOGIN\u REDIRECT\u URL='/'在我的twitter应用程序上,回调URL设置为http://127.0.0.1:8000/accounts/twitter/login/callback/ 我还尝试过创建适配器: from django.conf import se

我试图在
/account/profile
处重定向,但在使用django allauth时,我在
?next=/accounts/social/connections/
处被重定向

有什么想法吗?我的
设置.py
我已设置
LOGIN\u REDIRECT\u URL='/'
在我的twitter应用程序上,回调URL设置为
http://127.0.0.1:8000/accounts/twitter/login/callback/

我还尝试过创建适配器:

from django.conf import settings
from allauth.account.adapter import DefaultAccountAdapter

class MyAccountAdapter(DefaultAccountAdapter):

    def get_login_redirect_url(self, request):
        path = "/accounts/{username}/"
        return path.format(username=request.user.username)
和内部
settings.py

ACCOUNT_ADAPTER = 'sleep.adapter.MyAccountAdapter'
但它再次将我引向:


localhost:8000/accounts/login/?next=/accounts/social/connections/
这里可能会发生一些事情:

1) 社交媒体登录使用
settings.py
中的
SOCIALACCOUNT\u ADAPTER
(而不是
ACCOUNT\u ADAPTER
)指定的类。因此,使用当前的
设置.py
,当您连接到Twitter时,它将不会调用
sleep.adapter.MyAccountAdapter.get\u login\u redirect\u url()

2)
/accounts/social/connections/
是名为
socialaccount\u connections
的视图的默认URL。很可能您正在尝试连接您的Twitter帐户,而不是通过Twitter登录

确保模板中的
provider\u login\u url
标记未使用process=“connect”参数

{% load socialaccount %}
{% providers_media_js %}
<a href="{% provider_login_url "facebook" process="login" method="js_sdk" %}">Login with your Facebook Account</a>
{%load socialaccount%}
{%providers\u media\u js%}