django-socialregistration registration and login just isn't working
I'm seriously confused with getting django-socialregistration working.
So my settings file:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.contrib.messages.context_processors.messages",
"django.core.context_processors.request"
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'socialregistration.middleware.FacebookMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
FACEBOOK_REQUEST_PERMISSIONS = 'email,user_about_me'
AUTHENTICATION_BACKENDS = (
'socialregistration.auth.FacebookAuth',
'django.contrib.auth.backends.ModelBackend',
)
INSTALLED_APPS = (
...
'socialregistration',
...
)
FACEBOOK_APP_ID = '...'
FACEBOOK_API_KEY = '...'
FACEBOOK_SECRET_KEY = '...'
My views are using the request context, my templates have the required items to display the button and when click the FB connect button does open the pop up asking me if I want to connect with the app.
So here's where I get lost in what should happen.
Case 1: I'm a new user, never registered with example.com but I do have a FB account and see the FB connect button, so I click on it to register (this is django-socialregistration, shouldn't it be the starting point for the registration process?). Get the pop up and click the "allow" button on the FB pop up page and ... I get redirected to a page "/accounts/login/" with "Your username and password didn't match. Please try again."
In the Admin there's nothing created - no user account, no socialregistration facebook profiles, nada. If I go into my Facebook account settings it shows that I'm connected to my app.
Case 2: I'm an existing user, I login to my site, then click on the FB connect button. I get pop up, I click "allow" and get redirected to profile page. In the Admin, there is a new socialregistration facebook profile. I then log out of the site, come back and click on the facebook connect button and ... get redirected to "/accounts/login/" and the same your username/password didn't match.
help?! I've hit google so much trying to find others with the problem nada - folks talking about errors (errors I'd love, would let me track down wth is happening, but all I can tell is the authentication is just a big fat fail.).
Thanks in advance.
Edit: Partial fix on the issue to my question above Make sure you're pointing in your set开发者_开发百科tings.py to the template folder for the socialregistration app or move the templates into a location that's on your template path. That was my problem to the above question - however, I'm still not able to get this app working.
精彩评论