Skip to content

Commit 6e9a940

Browse files
committed
Beautified the built-in password-reset pages :P
1 parent 710f7b4 commit 6e9a940

File tree

5 files changed

+80
-3
lines changed

5 files changed

+80
-3
lines changed

chapter08/README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
- ```fields = ('username', 'email', 'age', )```
9898

9999

100-
# Chapter 09 (still based on Chapter 08)
100+
# Chapter 10 (still based on Chapter 08)
101101

102102
### Add some styles!
103103
- Here comes the **Bootstrap** !
@@ -146,6 +146,9 @@
146146
- before: ```{{ form.as_p }}```
147147
- after: ```{{ form | crispy }}```
148148

149+
150+
# Chapter 11 (still based on Chapter 08)
151+
149152
### Now, we're gonna talk about "password change & reset"
150153
- "We" will mention both
151154
1. the **built-in**
@@ -178,6 +181,20 @@
178181
- ya always should provided ur email while registering (debug purposes!)
179182
- *Django* will NOT mistaken whose password will be changed (even there's an user was online (by cookie))
180183
- and might add some styles, shall we?
181-
184+
- four templates, please!
185+
1. ```templates/registration/```**```password_reset_form.html```**
186+
2. ```templates/registration/```**```password_reset_done.html```**
187+
3. ```templates/registration/```**```password_reset_confirm.html```**
188+
4. ```templates/registration/```**```password_reset_complete.html```**
189+
- its exec orders (in users' perspective)
190+
- form => access the reset url (type ur email)
191+
- done => notification (we've sent for ya)
192+
- confirm => typing new password (**link** provided by Django (**at terminal**))
193+
- complete => reset complete (still notification)
194+
195+
196+
# Chapter 12 (still based on Chapter 08)
197+
198+
### Emails!
199+
- Third-party service: [SendGrid](https://sendgrid.com/)
182200

183-
- then we'll use a third-party service: [SendGrid](https://sendgrid.com/)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends 'base.html' %}
2+
3+
{% load crispy_forms_tags %}
4+
5+
{% block title %} Your password has been reset {% endblock title %}
6+
7+
{% block content %}
8+
9+
<h1>Your password has been reset!</h1>
10+
<p>
11+
Alright! Now you can use ur
12+
new password to <a href="{% url 'login' %}">log in 🐶</a> !
13+
</p>
14+
15+
{% endblock content %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% extends 'base.html' %}
2+
3+
{% load crispy_forms_tags %}
4+
5+
{% block title %} Enter new password {% endblock title %}
6+
7+
{% block content %}
8+
9+
<h1>Set a new password!</h1>
10+
11+
<form method="POST"> {% csrf_token %}
12+
{{ form | crispy }}
13+
<input class="btn btn-success" type="submit" value="Lemme change it!">
14+
</form>
15+
16+
{% endblock content %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends 'base.html' %}
2+
3+
{% load crispy_forms_tags %}
4+
5+
{% block title %} Email Sent {% endblock title %}
6+
7+
{% block content %}
8+
9+
<h1>Check ur inbox!</h1>
10+
<p>We've send for ya, go check it 😇 !</p>
11+
12+
{% endblock content %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{% extends 'base.html' %}
2+
3+
{% load crispy_forms_tags %}
4+
5+
{% block title %} Forget ur password? {% endblock title %}
6+
7+
{% block content %}
8+
9+
<h1>Forget ur password?</h1>
10+
<p>Please enter ur email below, and we'll email detailed instructions for ya.</p>
11+
12+
<form method="POST"> {% csrf_token %}
13+
{{ form | crispy }}
14+
<input class="btn btn-success" type="submit" value="Send me one!">
15+
</form>
16+
17+
{% endblock content %}

0 commit comments

Comments
 (0)