From 9cc5e6c8b3369c9132c5de6123b711fe3098ed80 Mon Sep 17 00:00:00 2001 From: Thiviyan Thanapalasingam Date: Sat, 18 May 2019 16:46:01 +0100 Subject: [PATCH 1/2] New feature: Reset password --- templates/registration/password_reset_complete.html | 5 +++++ templates/registration/password_reset_confirm.html | 9 +++++++++ templates/registration/password_reset_done.html | 5 +++++ templates/registration/password_reset_form.html | 12 ++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 templates/registration/password_reset_complete.html create mode 100644 templates/registration/password_reset_confirm.html create mode 100644 templates/registration/password_reset_done.html create mode 100644 templates/registration/password_reset_form.html diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..378e7cf --- /dev/null +++ b/templates/registration/password_reset_complete.html @@ -0,0 +1,5 @@ +{% extends 'base_generic.html' %} + +{% block content %} +

Your new password has been set. You can log in now on the log in page.

+{% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..6d3ad76 --- /dev/null +++ b/templates/registration/password_reset_confirm.html @@ -0,0 +1,9 @@ +{% extends 'base_generic.html' %} + +{% block content %} +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_done.html b/templates/registration/password_reset_done.html new file mode 100644 index 0000000..67c7de3 --- /dev/null +++ b/templates/registration/password_reset_done.html @@ -0,0 +1,5 @@ +{% extends 'base_generic.html' %} + +{% block content %} +

We've emailed you instructions for setting your password. You should receive the email shortly!

+{% endblock %} \ No newline at end of file diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html new file mode 100644 index 0000000..441d1e2 --- /dev/null +++ b/templates/registration/password_reset_form.html @@ -0,0 +1,12 @@ +{% extends 'base_generic.html' %} + +{% block content %} +

Forgot your password?

+

Enter your email address below, and we'll email instructions for setting a new one.

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} \ No newline at end of file From 34da14d51f08f8e5ad5d1b7014d42d447d6a0406 Mon Sep 17 00:00:00 2001 From: Thiviyan Thanapalasingam Date: Sat, 18 May 2019 16:49:55 +0100 Subject: [PATCH 2/2] New feature: Reset password --- gcmk_library/settings.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcmk_library/settings.py b/gcmk_library/settings.py index 8bcdbbc..d78e1b9 100644 --- a/gcmk_library/settings.py +++ b/gcmk_library/settings.py @@ -140,10 +140,6 @@ db_from_env = dj_database_url.config(conn_max_age=500) DATABASES['default'].update(db_from_env) - - - - import os LOGGING = { @@ -160,4 +156,7 @@ 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), }, }, -} \ No newline at end of file +} + +EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend" +EMAIL_FILE_PATH = os.path.join(BASE_DIR, "sent_emails")