Skip to content

Commit ab12f3d

Browse files
committedNov 20, 2024
add django allauth settings and migrate form django auth system #1895
1 parent 073112f commit ab12f3d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed
 

‎oeplatform/settings.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"tutorials_wizard": "https://openenergyplatform.github.io/academy/tutorials/99_other/wizard/", # noqa E501
9696
"tutorials_create_database_conform_data": "https://openenergyplatform.github.io/academy/tutorials/99_other/database_data/", # noqa E501
9797
"tutorials_oemetadata": "https://openenergyplatform.github.io/academy/tutorials/99_other/getting_started_with_OEMetadata/", # noqa E501
98-
"readthedocs": "https://openenergyplatform.github.io/oeplatform/oeplatform-code/web-api/oedb-rest-api/",
98+
"readthedocs": "https://openenergyplatform.github.io/oeplatform/oeplatform-code/web-api/oedb-rest-api/", # noqa E501
9999
"mkdocs": "https://openenergyplatform.github.io/oeplatform/",
100100
"compendium": "https://openenergyplatform.github.io/organisation/",
101101
"tib_terminology_service": "https://terminology.tib.eu/ts/collections",
@@ -201,8 +201,11 @@ def external_urls_context_processor(request):
201201
# https://docs.djangoproject.com/en/1.8/howto/static-files/
202202

203203
AUTH_USER_MODEL = "login.myuser"
204-
LOGIN_URL = "/user/login"
205-
LOGIN_REDIRECT_URL = "/"
204+
# https://docs.djangoproject.com/en/dev/ref/settings/#login-url
205+
LOGIN_URL = "account_login"
206+
# https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
207+
LOGIN_REDIRECT_URL = "login:redirect"
208+
# LOGIN_REDIRECT_URL = "/"
206209

207210
REST_FRAMEWORK = {
208211
"DEFAULT_AUTHENTICATION_CLASSES": (
@@ -241,3 +244,11 @@ def external_urls_context_processor(request):
241244
# ACCOUNT_EMAIL_REQUIRED = True
242245
# ACCOUNT_USERNAME_REQUIRED = False
243246
# ACCOUNT_AUTHENTICATION_METHOD = 'email'
247+
ACCOUNT_ALLOW_REGISTRATION = True
248+
249+
250+
# axes login throttling
251+
AXES_ENABLED = True
252+
AXES_FAILURE_LIMIT = 5 # Number of allowed attempts
253+
AXES_COOLOFF_TIME = 1 # Lockout period in hours
254+
AXES_ONLY_USER_FAILURES = True # Only track failures per user

0 commit comments

Comments
 (0)
Please sign in to comment.