From 733f487dc0b148048d84cd2276e4ecf4519b3796 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Mon, 4 Dec 2017 12:17:58 +0000 Subject: [PATCH] Enable password validators on the project template. Thanks to @tmsndrs for the heads-up! --- CHANGELOG.txt | 1 + docs/releases/2.0.rst | 1 + .../project_name/settings/base.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 87bbaabab8..3329f08724 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -36,6 +36,7 @@ Changelog * Fix: Prevent the footer and revisions link from unnecessarily collapsing on mobile (Jack Paine) * Fix: Empty searches were activated when paginating through images and documents (LB (Ben Johnston)) * Fix: Summary numbers of pages, images and documents were not responsive when greater than 4 digits (Michael Palmer) + * Fix: Project template now has password validators enabled by default (Matt Westcott) 1.13.1 (17.11.2017) diff --git a/docs/releases/2.0.rst b/docs/releases/2.0.rst index b6238816c2..203c49439f 100644 --- a/docs/releases/2.0.rst +++ b/docs/releases/2.0.rst @@ -54,6 +54,7 @@ Bug fixes * Prevent the footer and revisions link from unnecessarily collapsing on mobile (Jack Paine) * Empty searches were activated when paginating through images and documents (LB (Ben Johnston)) * Summary numbers of pages, images and documents were not responsive when greater than 4 digits (Michael Palmer) + * Project template now has password validators enabled by default (Matt Westcott) Upgrade considerations diff --git a/wagtail/project_template/project_name/settings/base.py b/wagtail/project_template/project_name/settings/base.py index 5453bba733..2c76b6c8c3 100644 --- a/wagtail/project_template/project_name/settings/base.py +++ b/wagtail/project_template/project_name/settings/base.py @@ -97,6 +97,25 @@ DATABASES = { } +# Password validation +# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + # Internationalization # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/