at Cartwheel Djangonaut at Revsys http://opencomparison.org Fiancé of Audrey Roy http://www.flickr.com/photos/pydanny/4442245488 Thursday, October 27, 11
Google • Linkedin • Github (YAY!) • Facebook ARGH The OAUTH specification is not honored well Implementation changes are sometimes not announced Thursday, October 27, 11
'social_auth', ... ) AUTHENTICATION_BACKENDS = ( 'social_auth.backends.contrib.github.GithubBackend', # keep this so you have that admin level backend access! 'django.contrib.auth.backends.ModelBackend', ) Thursday, October 27, 11
SOCIAL_AUTH_ENABLED_BACKENDS = ('github',) SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete' SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete' SOCIAL_AUTH_DEFAULT_USERNAME = lambda u: slugify(u) SOCIAL_AUTH_EXTRA_DATA = False SOCIAL_AUTH_CHANGE_SIGNAL_ONLY = True SOCIAL_AUTH_ASSOCIATE_BY_MAIL = True # associate user via email (Usually you can just go with these as your settings) Thursday, October 27, 11
from social_auth.backends.contrib.github import GithubBackend from profiles.models. import Profile def github_user_update(sender, user, response, details, **kwargs): profile_instance, created = Profile.objects.get_or_create(user=user) profile_instance.save() return True pre_update.connect(github_user_update, sender=GithubBackend) (Not specifying this view in urls - django-social-auth does it for me) Thursday, October 27, 11