from importlib import import_module

from django.conf.urls import include, url

from allauth.socialaccount import providers

from . import app_settings


urlpatterns = [url(r'^', include('allauth.account.urls'))]

if app_settings.SOCIALACCOUNT_ENABLED:
    urlpatterns += [url(r'^social/', include('allauth.socialaccount.urls'))]

for provider in providers.registry.get_list():
    try:
        prov_mod = import_module(provider.get_package() + '.urls')
    except ImportError:
        continue
    prov_urlpatterns = getattr(prov_mod, 'urlpatterns', None)
    if prov_urlpatterns:
        urlpatterns += prov_urlpatterns

@@ -324,16 +324,107 @@
 ls'))%5D%0A%0A
+# Provider urlpatterns, as separate attribute (for reusability).%0Aprovider_urlpatterns = %5B%5D%0A
 for prov
@@ -670,24 +670,33 @@
 ns:%0A        
+provider_
 urlpatterns 
@@ -715,8 +715,44 @@
 atterns%0A
+urlpatterns += provider_urlpatterns%0A

add allauth.urls.provider_urlpatterns