Skip to content

Commit

Permalink
add django allauth settings and migrate form django auth system #1895
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-RLI committed Nov 20, 2024
1 parent 073112f commit ab12f3d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions oeplatform/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"tutorials_wizard": "https://openenergyplatform.github.io/academy/tutorials/99_other/wizard/", # noqa E501
"tutorials_create_database_conform_data": "https://openenergyplatform.github.io/academy/tutorials/99_other/database_data/", # noqa E501
"tutorials_oemetadata": "https://openenergyplatform.github.io/academy/tutorials/99_other/getting_started_with_OEMetadata/", # noqa E501
"readthedocs": "https://openenergyplatform.github.io/oeplatform/oeplatform-code/web-api/oedb-rest-api/",
"readthedocs": "https://openenergyplatform.github.io/oeplatform/oeplatform-code/web-api/oedb-rest-api/", # noqa E501
"mkdocs": "https://openenergyplatform.github.io/oeplatform/",
"compendium": "https://openenergyplatform.github.io/organisation/",
"tib_terminology_service": "https://terminology.tib.eu/ts/collections",
Expand Down Expand Up @@ -201,8 +201,11 @@ def external_urls_context_processor(request):
# https://docs.djangoproject.com/en/1.8/howto/static-files/

AUTH_USER_MODEL = "login.myuser"
LOGIN_URL = "/user/login"
LOGIN_REDIRECT_URL = "/"
# https://docs.djangoproject.com/en/dev/ref/settings/#login-url
LOGIN_URL = "account_login"
# https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
LOGIN_REDIRECT_URL = "login:redirect"
# LOGIN_REDIRECT_URL = "/"

REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
Expand Down Expand Up @@ -241,3 +244,11 @@ def external_urls_context_processor(request):
# ACCOUNT_EMAIL_REQUIRED = True
# ACCOUNT_USERNAME_REQUIRED = False
# ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_ALLOW_REGISTRATION = True


# axes login throttling
AXES_ENABLED = True
AXES_FAILURE_LIMIT = 5 # Number of allowed attempts
AXES_COOLOFF_TIME = 1 # Lockout period in hours
AXES_ONLY_USER_FAILURES = True # Only track failures per user

0 comments on commit ab12f3d

Please sign in to comment.