I am working on a django project using python-social-auth to do authentication with facebook. I am running the django server on localhost and have facebook set up with my ap
This error was due to the session cookie not being saved over a non-https url. When testing on localhost with SESSION_COOKIE_SECURE set to True in django, the session cookies will not persist between redirect and you will get this error in any kind of page change where session would be checked.
SESSION_COOKIE_SECURE=False for testing and it's all good
Solved it by removing LOGIN_REDIRECT_URL
from django settings.
Actually python_social_auth pipeline structure sets LOGIN_REDIRECT_URL
as next
i.e redirect to url, but unfortunately they didn't handled named patterns. So, when we set LOGIN_REDIRECT_URL
to myapp:index
it produces this error.
So, either remove this setting or use direct patterns i.e
LOGIN_REDIRECT_URL
= myapp/index
I also had this problem. Solved it by adding "SOCIAL_AUTH_REDIRECT_IS_HTTPS = True" in my settings.py file, since my configuration is using nginx to redirect to HTTPS. I found this answer only by reading the documentation here: https://python-social-auth-docs.readthedocs.io/en/latest/configuration/settings.html