Skip to content

Commit 392a959

Browse files
committed
add allauth settings to setup login adapters #1895
1 parent 3ac09d1 commit 392a959

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

oeplatform/settings.py

+12
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,24 @@ def external_urls_context_processor(request):
241241

242242
ACCOUNT_USER_MODEL_USERNAME_FIELD = "name"
243243
ACCOUNT_USER_MODEL_EMAIL_FIELD = "email"
244+
# https://django-allauth.readthedocs.io/en/latest/configuration.html
245+
# ACCOUNT_EMAIL_VERIFICATION = "mandatory" # requires ACCOUNT_EMAIL_REQUIRED = True
246+
# https://django-allauth.readthedocs.io/en/latest/configuration.html
247+
ACCOUNT_ADAPTER = "login.adapters.AccountAdapter"
248+
# https://django-allauth.readthedocs.io/en/latest/forms.html
249+
ACCOUNT_FORMS = {"signup": "login.forms.CreateUserForm"}
244250
# ACCOUNT_EMAIL_REQUIRED = True
245251
# ACCOUNT_USERNAME_REQUIRED = False
246252
# ACCOUNT_AUTHENTICATION_METHOD = 'email'
247253
ACCOUNT_ALLOW_REGISTRATION = True
248254

249255

256+
# https://django-allauth.readthedocs.io/en/latest/configuration.html
257+
SOCIALACCOUNT_ADAPTER = "login.adapters.SocialAccountAdapter"
258+
# https://django-allauth.readthedocs.io/en/latest/forms.html
259+
SOCIALACCOUNT_FORMS = {"signup": "htmxdj.users.forms.UserSocialSignupForm"}
260+
261+
250262
# axes login throttling
251263
AXES_ENABLED = True
252264
AXES_FAILURE_LIMIT = 5 # Number of allowed attempts

0 commit comments

Comments
 (0)