From: Matías Aguirre Date: Fri, 14 Jan 2011 05:13:58 +0000 (-0200) Subject: Google OAuth support in example proyect X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=34fece05a18f0cb34f8f3e57927b74af2e633bce;p=django-social-auth.git Google OAuth support in example proyect --- diff --git a/example/app/views.py b/example/app/views.py index 74d2cff..50f3b3e 100644 --- a/example/app/views.py +++ b/example/app/views.py @@ -17,7 +17,8 @@ def done(request): """Login complete view, displays user data""" names = request.user.social_auth.values_list('provider', flat=True) return render_to_response('done.html', - dict((name.lower(), True) for name in names), + dict((name.lower().replace('-', '_'), True) + for name in names), RequestContext(request)) def error(request): diff --git a/example/settings.py b/example/settings.py index 84716d2..1b00089 100644 --- a/example/settings.py +++ b/example/settings.py @@ -1,6 +1,3 @@ -import sys -import random -import os from os.path import abspath, dirname, basename, join DEBUG = True @@ -67,6 +64,7 @@ INSTALLED_APPS = ( AUTHENTICATION_BACKENDS = ( 'social_auth.backends.TwitterBackend', 'social_auth.backends.FacebookBackend', + 'social_auth.backends.GoogleOAuthBackend', 'social_auth.backends.GoogleBackend', 'social_auth.backends.YahooBackend', 'social_auth.backends.OpenIDBackend', diff --git a/example/templates/done.html b/example/templates/done.html index e8a4262..a558549 100644 --- a/example/templates/done.html +++ b/example/templates/done.html @@ -15,7 +15,7 @@
-

Associate new credentials:

+

Associate new OAuth credentials:

+ +

Associate new OpenID credentials:

+