django-allauth与SSL:“DoesNotExist at / accounts / google / login / callback /”

时间:2014-09-08 10:40:25

标签: django ssl django-allauth

我正在localhost中测试我的django(1.6.5)应用。我使用django-allauth并且没有ssl一切都很好。

我安装了django-sslserver并更改如下:

Settings.py

ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'    # allauth

SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
os.environ['HTTPS'] = "on"

Api Google控制台

REDIRECT URIS : http://localhost:8000/accounts/google/login/callback/
                https://localhost:8000/accounts/google/login/callback/

当我使用我的Google帐户登录时,我接受了授权,但是当它重定向回我的应用时,会显示错误:

DoesNotExist at /accounts/google/login/callback/
User matching query does not exist.
Request URL:    https://localhost:8000/accounts/google/login/callback/?state=PwKj3DsvzmNp&code=4/16ttwvGn7SIZKyHWZ9sSy8YOx7sg.4t9M4AcGcoEfoiIBeO6P2m9E6KmpkAI

allauth/socialaccount/helpers.py in _login_social_account

def _login_social_account(request, sociallogin):
**return perform_login(request, sociallogin.account.user, ...**
                     email_verification=app_settings.EMAIL_VERIFICATION,
                     redirect_url=sociallogin.get_redirect_url(request),
                     signal_kwargs={"sociallogin": sociallogin})

错误在返回行中。 你能帮助我吗?谢谢! :)

0 个答案:

没有答案