Generateurv2/backend/env/lib/python3.10/site-packages/allauth/urls.py

26 lines
752 B
Python
Raw Normal View History

2022-06-24 17:14:37 +02:00
from importlib import import_module
from django.urls import include, path
from allauth.socialaccount import providers
from . import app_settings
urlpatterns = [path("", include("allauth.account.urls"))]
if app_settings.SOCIALACCOUNT_ENABLED:
urlpatterns += [path("social/", include("allauth.socialaccount.urls"))]
# Provider urlpatterns, as separate attribute (for reusability).
provider_urlpatterns = []
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:
provider_urlpatterns += prov_urlpatterns
urlpatterns += provider_urlpatterns