Skip to content

Commit

Permalink
Initial Allauth dependency and settings/urls
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed Oct 3, 2019
1 parent 3146f9b commit 99bc330
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 46 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pygments = "~=2.3.1"
wiki = {path = "./docker/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl"}
pyyaml = "~=5.1"
pyuwsgi = "~=2.0"
django-allauth = "~=0.40"

[dev-packages]
coverage = "~=4.5.3"
Expand Down
128 changes: 82 additions & 46 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pydis_site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@
'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',
Expand Down Expand Up @@ -347,3 +354,13 @@
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',
)
1 change: 1 addition & 0 deletions pydis_site/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
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')),
)

0 comments on commit 99bc330

Please sign in to comment.