"""URLs module"""
from django import VERSION
from django.conf import settings
from django.conf.urls import url
from social.apps.django_app import views

from social.utils import setting_name


extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or ''

urlpatterns = (
    # authentication / association
    url(r'^login/(?P<backend>[^/]+){0}$'.format(extra),
        views.auth,
        name='begin'),
    url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra),
        views.complete,
        name='complete'),
    # disconnection
    url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra),
        views.disconnect,
        name='disconnect'),
    url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$'
            .format(extra),
        views.disconnect,
        name='disconnect_individual'),
)

"""URLs module"""
from django.conf import settings
try:
    from django.conf.urls import patterns, url
except ImportError:
    # Django < 1.4
    from django.conf.urls.defaults import patterns, url


from social.utils import setting_name


extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or ''


urlpatterns = patterns('social.apps.django_app.views',
    # authentication / association
    url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth',
        name='begin'),
    url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete',
        name='complete'),
    # disconnection
    url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect',
        name='disconnect'),
    url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$'
            .format(extra), 'disconnect', name='disconnect_individual'),
)

--- 
+++ 
@@ -1,27 +1,28 @@
 """URLs module"""
+from django import VERSION
 from django.conf import settings
-try:
-    from django.conf.urls import patterns, url
-except ImportError:
-    # Django < 1.4
-    from django.conf.urls.defaults import patterns, url
-
+from django.conf.urls import url
+from social.apps.django_app import views
 
 from social.utils import setting_name
 
 
 extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or ''
 
-
-urlpatterns = patterns('social.apps.django_app.views',
+urlpatterns = (
     # authentication / association
-    url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth',
+    url(r'^login/(?P<backend>[^/]+){0}$'.format(extra),
+        views.auth,
         name='begin'),
-    url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete',
+    url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra),
+        views.complete,
         name='complete'),
     # disconnection
-    url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect',
+    url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra),
+        views.disconnect,
         name='disconnect'),
     url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$'
-            .format(extra), 'disconnect', name='disconnect_individual'),
+            .format(extra),
+        views.disconnect,
+        name='disconnect_individual'),
 )
Update the url patterns to be compliant with Django 1.9 new formatting

so need to support Django < 1.8 because it is now deprecated for
security reasons
