0

I was trying to use the social authentication on my application. Until now, I did not face with any problem. However in this application I am using Django 1.5.1 and application redirects me to error page and I can not find any solution or traceback.

And also when I check from the admin page, I see that social registration profile or my custom user have not been created. (I did not have the username field on create_user method, but after I checked other questions, I also added that.)

And the redirect url is, "GET /complete/facebook/?redirect_state=.....&state=.... HTTP/1.1" 302 0

# Settings

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.request',
    'django.contrib.messages.context_processors.messages',
    'social_auth.context_processors.social_auth_by_name_backends',
    'social_auth.context_processors.social_auth_backends',
    'social_auth.context_processors.social_auth_login_redirect',
)

FACEBOOK_APP_ID = 'XXX'
FACEBOOK_API_SECRET = 'XXX'

AUTHENTICATION_BACKENDS = (
    'social_auth.backends.facebook.FacebookBackend',
    'django.contrib.auth.backends.ModelBackend',
)

FACEBOOK_EXTENDED_PERMISSIONS = ['email']

SOCIAL_AUTH_USER_MODEL = 'accounts.CustomUser'
SOCIAL_AUTH_RAISE_EXCEPTIONS = True

LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/'
LOGIN_ERROR_URL    = '/facebook/error/'

I tried to follow the error from the social-auth/views.py and saw that error is "No handlers could be found for logger "SocialAuth"" coming from somewhere, but I have no idea how to fix that.

Is there anyone who knows the solution or saw this error in this situation?

grgizem
  • 311
  • 3
  • 11

1 Answers1

0

Nothing is your settings is standing out as being incorrect.

I remember having similar issues getting Facebook and django-social-auth to play nicely together when I first implemented it. The problem ended up not being with Django or django-social-auth, but rather with how my app was configured on Facebook's end. If this is a problem you are only experiencing in a test environment (localhost), then try reading this post and see if it helps resolve your issue; the culprit may be that the Site URL on Facebook is set to localhost (which Facebook does not support).

Community
  • 1
  • 1
Joseph Paetz
  • 876
  • 1
  • 7
  • 12
  • I used before the Facebook integration with the local host on other project. I think that should not be the problem. I tried to switch to the prod server but I see the same log on apaches error log, unfortunately. But thanks I will check the settings on Facebook. – grgizem Aug 21 '13 at 03:22