started upgrading to Django 1.6: switched social-auth to python-social-auth
authordurandn
Fri, 27 Mar 2015 18:11:26 +0100
changeset 239 6888d282b4cc
parent 238 db7fe20d3dc3
child 240 53931ed55bc9
started upgrading to Django 1.6: switched social-auth to python-social-auth
src/ldtplatform/settings.py
src/ldtplatform/urls.py
--- a/src/ldtplatform/settings.py	Wed Apr 29 00:56:10 2015 +0200
+++ b/src/ldtplatform/settings.py	Fri Mar 27 18:11:26 2015 +0100
@@ -90,7 +90,7 @@
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     #'django.middleware.locale.LocaleMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
-    'django_openid_consumer.middleware.OpenIDMiddleware',
+    #'django_openid_consumer.middleware.OpenIDMiddleware',
     'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware',
     'ldt.security.middleware.SecurityMiddleware',
 )
@@ -137,8 +137,8 @@
     'taggit_templatetags',
     'registration',
     'oauth_provider',
-    'django_openid_consumer',
-    'social_auth',
+    #'django_openid_consumer',
+    'social.apps.django_app.default',
     'south',
     'sorl.thumbnail',
     'ldt',
@@ -168,18 +168,14 @@
 )
 
 AUTHENTICATION_BACKENDS = (
-    'social_auth.backends.twitter.TwitterBackend',
-    'social_auth.backends.facebook.FacebookBackend',
-#    'social_auth.backends.google.GoogleOAuthBackend',
-#    'social_auth.backends.google.GoogleOAuth2Backend',
-    'social_auth.backends.google.GoogleBackend',
-    'social_auth.backends.yahoo.YahooBackend',
-#    'social_auth.backends.contrib.linkedin.LinkedinBackend',
-#    'social_auth.backends.contrib.LiveJournalBackend',
-#    'social_auth.backends.contrib.orkut.OrkutBackend',
-    'social_auth.backends.OpenIDBackend',
+    'social.backends.open_id.OpenIdAuth',
+    'social.backends.google.GoogleOpenId',
+    #'social.backends.google.GoogleOAuth2',
+    #'social.backends.google.GoogleOAuth',
+    'social.backends.twitter.TwitterOAuth',
+    'social.backends.facebook.FacebookOAuth2',
+    'guardian.backends.ObjectPermissionBackend',
     'django.contrib.auth.backends.ModelBackend',
-    'guardian.backends.ObjectPermissionBackend',
 )
 #SOCIAL_AUTH_IMPORT_BACKENDS = (
 #    'myproy.social_auth_extra_services',
@@ -205,10 +201,10 @@
 OAUTH_CALLBACK_VIEW = 'oauth_provider.views.fake_callback_view'
 TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888"
 
-TWITTER_CONSUMER_KEY     = 'UxAdbOLSo4Mx3CXIwDG9Eg'
-TWITTER_CONSUMER_SECRET  = '2PcWgdjnJL6Vp8srB40jeAo0fjMEtDnUwmAia6EUww'
-FACEBOOK_APP_ID = '163134140411313'
-FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012'
+SOCIAL_AUTH_TWITTER_KEY     = 'UxAdbOLSo4Mx3CXIwDG9Eg'
+SOCIAL_AUTH_TWITTER_SECRET  = '2PcWgdjnJL6Vp8srB40jeAo0fjMEtDnUwmAia6EUww'
+SOCIAL_AUTH_FACEBOOK_KEY = '163134140411313'
+SOCIAL_AUTH_FACEBOOK_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012'
 
 SOCIAL_AUTH_COMPLETE_URL_NAME  = 'complete'
 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete'
--- a/src/ldtplatform/urls.py	Wed Apr 29 00:56:10 2015 +0200
+++ b/src/ldtplatform/urls.py	Fri Mar 27 18:11:26 2015 +0100
@@ -35,7 +35,7 @@
     (r'^auth_accounts/', include('registration.backends.simple.urls')),
 
     #(r'^accounts/', include('socialauth.urls')),
-    (r'^accounts/', include('social_auth.urls')),
+    (r'^accounts/', include('social.apps.django_app.urls', namespace='social')),
     url(r'^accounts/login/$',pf_login,{'template_name': 'registration/login.html'},name='auth_login'),
     (r'^oauth/', include('oauth_provider.urls')),