浏览代码

Enable password validators on the project template.

Thanks to @tmsndrs for the heads-up!
Matt Westcott 7 年之前
父节点
当前提交
733f487dc0
共有 3 个文件被更改,包括 21 次插入0 次删除
  1. 1 0
      CHANGELOG.txt
  2. 1 0
      docs/releases/2.0.rst
  3. 19 0
      wagtail/project_template/project_name/settings/base.py

+ 1 - 0
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)

+ 1 - 0
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

+ 19 - 0
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/