diff options
| author | 2019-10-03 15:08:07 +0100 | |
|---|---|---|
| committer | 2019-10-03 15:08:07 +0100 | |
| commit | 99bc330bf50232e6302a12ea86c62745f5d87fef (patch) | |
| tree | 6734357165cda6bc5ab2f28d1d73882f4278d805 /pydis_site | |
| parent | Add link to Contributing landing page to our website's navbar (#270) (diff) | |
Initial Allauth dependency and settings/urls
Diffstat (limited to 'pydis_site')
| -rw-r--r-- | pydis_site/settings.py | 17 | ||||
| -rw-r--r-- | pydis_site/urls.py | 1 | 
2 files changed, 18 insertions, 0 deletions
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')),  )  |