Skip to content

Commit

Permalink
Add 2fa to website CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
wakibi committed Apr 15, 2024
1 parent d9d3a30 commit ec69db5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions di_website/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
'django.contrib.staticfiles',
'django.contrib.postgres',

# Wagtail 2FA (https://github.com/labd/wagtail-2fa)
'wagtail_2fa',
'django_otp',
'django_otp.plugins.otp_totp',

]

MIDDLEWARE = [
Expand All @@ -105,6 +110,8 @@
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
# Wagtail 2FA (https://github.com/labd/wagtail-2fa)
'wagtail_2fa.middleware.VerifyUserMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
Expand Down Expand Up @@ -233,6 +240,10 @@

WAGTAIL_SITE_NAME = "Development Initiatives Website"

# Wagtail 2FA settings (https://github.com/labd/wagtail-2fa)
WAGTAIL_2FA_REQUIRED = True
WAGTAIL_2FA_OTP_TOTP_NAME = "DI Website CMS"

# Base URL to use when referring to full URLs within the Wagtail admin backend -
# e.g. in notification emails. Don't include '/admin' or a trailing slash
WAGTAILADMIN_BASE_URL = os.getenv('BASE_URL') or 'http://devinit.org'
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ wagtail-metadata>=4.0.2,<4.1.0
whitenoise==5.2.0
wagtailmedia>=0.13.0,<1.0.0
PyGithub==1.54.1
wagtail-2fa==1.6.9

0 comments on commit ec69db5

Please sign in to comment.