From f7d10df3d29b14e765b954c0cbe46c4ddb2f74f1 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 17 Dec 2016 22:22:16 +0000 Subject: [PATCH] Add password protected pages --- project/settings.py | 12 ++-------- requirements.txt | 1 + templates/pages/password_required.html | 33 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 templates/pages/password_required.html diff --git a/project/settings.py b/project/settings.py index ae82e55..a22ebd8 100755 --- a/project/settings.py +++ b/project/settings.py @@ -42,6 +42,7 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'wagtailmetadata', + 'bootstrapform', 'project.blog', 'project.common', @@ -166,14 +167,5 @@ WAGTAILSEARCH_BACKENDS = { BASE_URL = 'https://theorangeone.net' SITE_URL = BASE_URL +PASSWORD_REQUIRED_TEMPLATE = 'pages/password_required.html' -# Password policy settings -SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' -PASSWORD_CHECK_ONLY_AT_LOGIN = True -PASSWORD_MIN_LENGTH = 7 -PASSWORD_MAX_LENGTH = 25 -PASSWORD_HISTORY_COUNT = 6 -PASSWORD_MIN_LETTERS = 1 -PASSWORD_MIN_NUMBERS = 1 -PASSWORD_MIN_SYMBOLS = 1 -PASSWORD_DIFFERENCE_DISTANCE = 3 diff --git a/requirements.txt b/requirements.txt index 2ba3404..dac566c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ bleach==1.5 coverage==4.2 dj_database_url==0.4.1 Django>=1.10,<1.11 +django-bootstrap-form==3.2.1 flake8==3.2.1 honcho==0.7.1 psycopg2==2.6.2 diff --git a/templates/pages/password_required.html b/templates/pages/password_required.html new file mode 100644 index 0000000..7e84d0c --- /dev/null +++ b/templates/pages/password_required.html @@ -0,0 +1,33 @@ +{% extends "base.html" %} + +{% load wagtailcore_tags bootstrap %} + +{% block body_class %}template-passwordrequied{% endblock %} + +{% block content %} +
+
+
+
+

Authentication Required

+
+
+
+
+
+
+
+

+ +

+

You need a password to access this page.

+
+ {% csrf_token %} + {{ form|bootstrap }} +
+ +
+
+
+
+{% endblock %}