From 99bc330bf50232e6302a12ea86c62745f5d87fef Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Thu, 3 Oct 2019 15:08:07 +0100 Subject: Initial Allauth dependency and settings/urls --- pydis_site/settings.py | 17 +++++++++++++++++ pydis_site/urls.py | 1 + 2 files changed, 18 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 4534f54b..189c35e6 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -82,6 +82,13 @@ INSTALLED_APPS = [ 'django.contrib.sites.apps.SitesConfig', 'django.contrib.staticfiles', + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + + 'allauth.socialaccount.providers.discord', + 'allauth.socialaccount.providers.github', + 'crispy_forms', 'django_crispy_bulma', 'django_hosts', @@ -347,3 +354,13 @@ WIKI_MARKDOWN_HTML_ATTRIBUTES = { WIKI_MARKDOWN_HTML_WHITELIST = [ 'article', 'section', 'button' ] + +# Django Allauth stuff + +AUTHENTICATION_BACKENDS = ( + # Needed to login by username in Django admin, regardless of `allauth` + 'django.contrib.auth.backends.ModelBackend', + + # `allauth` specific authentication methods, such as login by e-mail + 'allauth.account.auth_backends.AuthenticationBackend', +) diff --git a/pydis_site/urls.py b/pydis_site/urls.py index 47cf0ba1..f31e88a4 100644 --- a/pydis_site/urls.py +++ b/pydis_site/urls.py @@ -4,4 +4,5 @@ from django.urls import include, path urlpatterns = ( path('', include('pydis_site.apps.home.urls', namespace='home')), path('staff/', include('pydis_site.apps.staff.urls', namespace='staff')), + path('accounts/', include('allauth.urls', namespace='auth')), ) -- cgit v1.2.3