Add Django-AllAuth app
This commit is contained in:
parent
ff5f5dd2e4
commit
dac078f7db
3 changed files with 18 additions and 3 deletions
|
|
@ -41,6 +41,9 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sites',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'allauth',
|
||||
'allauth.account',
|
||||
'allauth.socialaccount',
|
||||
'crispy_forms',
|
||||
'photologue_custom',
|
||||
'photologue',
|
||||
|
|
@ -81,6 +84,14 @@ TEMPLATES = [
|
|||
},
|
||||
]
|
||||
|
||||
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',
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'photo21.wsgi.application'
|
||||
|
||||
|
||||
|
|
@ -168,7 +179,11 @@ SESSION_COOKIE_AGE = 60 * 60 * 3
|
|||
# Use only one Django Sites
|
||||
SITE_ID = 1
|
||||
|
||||
# use Bootstrap forms
|
||||
# Allauth configuration
|
||||
ACCOUNT_EMAIL_REQUIRED = True
|
||||
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
||||
|
||||
# Use Bootstrap forms
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
||||
|
||||
# Photologue
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ urlpatterns = [
|
|||
path('', IndexView.as_view(), name='index'),
|
||||
path('photologue/', include('photologue_custom.urls')),
|
||||
path('photologue/', include('photologue.urls', namespace='photologue')),
|
||||
path('accounts/', include('django.contrib.auth.urls')),
|
||||
path('accounts/', include('accounts.urls')),
|
||||
path('accounts/', include('allauth.urls')),
|
||||
path('i18n/', include('django.conf.urls.i18n')),
|
||||
path('admin/', admin.site.urls),
|
||||
path('admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue