diff options
author | Prabhu Ramachandran | 2016-03-09 15:43:02 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2016-03-09 15:43:02 +0530 |
commit | ef3cd39ebdf9d9fc9011ba4bc470ec5018bb8077 (patch) | |
tree | df19f9ffcac549c1986728cd822fd4fe1bfea22a | |
parent | 4874eb1e66c12269fa75849048afd2c9f129d5e3 (diff) | |
parent | edf173722f9d14dd32cd8dba381ede5973b52a70 (diff) | |
download | online_test-ef3cd39ebdf9d9fc9011ba4bc470ec5018bb8077.tar.gz online_test-ef3cd39ebdf9d9fc9011ba4bc470ec5018bb8077.tar.bz2 online_test-ef3cd39ebdf9d9fc9011ba4bc470ec5018bb8077.zip |
Merge pull request #83 from prathamesh920/forgot_password
Forgot password
-rw-r--r-- | online_test/settings.py | 12 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_complete.html | 7 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_confirm.html | 17 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_done.html | 4 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_form.html | 12 | ||||
-rw-r--r-- | yaksh/urls.py | 11 |
6 files changed, 62 insertions, 1 deletions
diff --git a/online_test/settings.py b/online_test/settings.py index f96632b..3993744 100644 --- a/online_test/settings.py +++ b/online_test/settings.py @@ -88,3 +88,15 @@ USE_TZ = False STATIC_URL = '/static/' LOGIN_URL = '/exam/login' + +EMAIL_USE_TLS = False + +EMAIL_HOST = 'your_email_host' + +EMAIL_PORT = 'your_email_port' + +EMAIL_HOST_USER = 'email_host_user' + +DEFAULT_FROM_EMAIL = EMAIL_HOST_USER + +TEMPLATE_DIRS = ['yaksh/templates',] diff --git a/yaksh/templates/registration/password_reset_complete.html b/yaksh/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..0801d3b --- /dev/null +++ b/yaksh/templates/registration/password_reset_complete.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} +{% block title %}Password reset complete{% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block content %} +<p>Your password has been reset. </p> +<p><a href="{{ login_url }}">Log in</a></p> +{% endblock %} diff --git a/yaksh/templates/registration/password_reset_confirm.html b/yaksh/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..5566499 --- /dev/null +++ b/yaksh/templates/registration/password_reset_confirm.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block title %}Reset Password{% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %} Reset password {% endblock %} + +{% block content %} + {% if validlink %} + <p>Please enter your new password twice so we can verify you typed it in correctly</p>. + <form method="post"> + {% csrf_token %} + {{ form.as_p }} + <button class= "btn" type="submit">Submit</button> + </form> + {% else %} + <p>This reset link is no longer valid!</p> + {% endif %} +{% endblock %} diff --git a/yaksh/templates/registration/password_reset_done.html b/yaksh/templates/registration/password_reset_done.html new file mode 100644 index 0000000..ace3cc9 --- /dev/null +++ b/yaksh/templates/registration/password_reset_done.html @@ -0,0 +1,4 @@ +{% extends "base.html" %} +{% block title %}Password reset successful{% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %} Instruction for setting new password has been mailed to your registered email address {% endblock %} diff --git a/yaksh/templates/registration/password_reset_form.html b/yaksh/templates/registration/password_reset_form.html new file mode 100644 index 0000000..0dbaf09 --- /dev/null +++ b/yaksh/templates/registration/password_reset_form.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} +{% block title %} Forgot Password {% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %} Email will be send to the registered email address {% endblock %} +{% block content %} +<form action="" method="post"> + {% csrf_token %} + {{ form }} + <button class="btn" type="submit">Request</button> + <a class="btn" href="{{URL_ROOT}}/exam/login/">Cancel</a> +</form> +{% endblock content %} diff --git a/yaksh/urls.py b/yaksh/urls.py index ad0a925..d74e244 100644 --- a/yaksh/urls.py +++ b/yaksh/urls.py @@ -1,6 +1,15 @@ from django.conf.urls import patterns, url -urlpatterns = patterns('yaksh.views', +urlpatterns = patterns('django.contrib.auth.views', + url(r'^forgotpassword/$', 'password_reset', name="password_reset"), + url(r'^password_reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', + 'password_reset_confirm', name='password_reset_confirm'), + url(r'^password_reset/mail_sent/$', 'password_reset_done', + name='password_reset_done'), + url(r'^password_reset/complete/$', 'password_reset_complete', + name='password_reset_complete'), +) +urlpatterns += patterns('yaksh.views', url(r'^$', 'index'), url(r'^login/$', 'user_login'), url(r'^quizzes/$', 'quizlist_user'), |