Django-allauth with SSL: "DoNotExist at / accounts / google / login / callback /"

I am testing my django app (1.6.5) on localhost. I am using django-allauth and without ssl everything is fine.

I installed django-sslserver and changed the following:

Settings.py

ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'    # allauth

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

      

Api Google Console

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

      

When I logged in with my google account, I accepted authorization, but when it is redirected back to my application, an error message appears:

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})

      

Return line error. Could you help me? Thank you! :)

+3


source to share





All Articles