@@ -54,7 +54,6 @@ class SendLoginEmailViewTest(TestCase):
54
54
self.assertRedirects(response, "/")
55
55
----
56
56
====
57
- //ch17l003
58
57
59
58
60
59
Wire up the `include` in 'superlists/urls.py', plus the `url` in
@@ -74,7 +73,6 @@ def send_login_email(request):
74
73
return redirect("/")
75
74
----
76
75
====
77
- //ch17l003
78
76
79
77
80
78
I've added the import of the `send_mail` function as a placeholder for now:
@@ -1569,7 +1567,7 @@ Let's give `authenticate` the arguments it expects then:
1569
1567
1570
1568
1571
1569
[role="sourcecode"]
1572
- .src/accounts/views.py (ch17l040 )
1570
+ .src/accounts/views.py (ch19l040 )
1573
1571
====
1574
1572
[source,python]
1575
1573
----
@@ -1655,7 +1653,7 @@ Let's try doing that. Deliberately wrong as usual first!
1655
1653
1656
1654
1657
1655
[role="sourcecode"]
1658
- .src/accounts/views.py (ch17l042 )
1656
+ .src/accounts/views.py (ch19l042 )
1659
1657
====
1660
1658
[source,python]
1661
1659
----
@@ -1680,7 +1678,7 @@ AssertionError: call('ack!') != call(<WSGIRequest: GET
1680
1678
Let's fix that:
1681
1679
1682
1680
[role="sourcecode"]
1683
- .src/accounts/views.py (ch17l043 )
1681
+ .src/accounts/views.py (ch19l043 )
1684
1682
====
1685
1683
[source,python]
1686
1684
----
@@ -1777,7 +1775,7 @@ And we get it passing like this:
1777
1775
1778
1776
1779
1777
[role="sourcecode"]
1780
- .src/accounts/views.py (ch17l045 )
1778
+ .src/accounts/views.py (ch19l045 )
1781
1779
====
1782
1780
[source,python]
1783
1781
----
@@ -1943,7 +1941,7 @@ It's because of two things:
1943
1941
* Firstly, we need to re-add the email configuration to _settings.py_.
1944
1942
1945
1943
[role="sourcecode"]
1946
- .src/superlists/settings.py (ch17l049 )
1944
+ .src/superlists/settings.py (ch19l047 )
1947
1945
====
1948
1946
[source,python]
1949
1947
----
@@ -1972,8 +1970,10 @@ to get a working login system without this one.
1972
1970
Just as we do on the server, you can also use a _.env_ file to save
1973
1971
project-specific environment variables:
1974
1972
1973
+ [role="skip"]
1975
1974
[subs="specialcharacters,quotes"]
1976
1975
----
1976
+ $ *echo .env >> .gitignore* # we don't want to commit our secrets into git!
1977
1977
$ *echo EMAIL_PASSWORD="yoursekritpasswordhere" >> .env*
1978
1978
$ *set -a; source .env; set +a;*
1979
1979
----
@@ -2039,7 +2039,7 @@ The last thing we need to do before we call it a day is to test the logout link
2039
2039
We extend the FT with a couple more steps:
2040
2040
2041
2041
[role="sourcecode"]
2042
- .src/functional_tests/test_login.py (ch17l050 )
2042
+ .src/functional_tests/test_login.py (ch19l048 )
2043
2043
====
2044
2044
[source,python]
2045
2045
----
@@ -2076,7 +2076,7 @@ element: input[name=email]; [...]
2076
2076
So let's tell the base template that we want a new url named "logout":
2077
2077
2078
2078
[role="sourcecode small-code"]
2079
- .src/lists/templates/base.html (ch19l051 )
2079
+ .src/lists/templates/base.html (ch19l049 )
2080
2080
====
2081
2081
[source,html]
2082
2082
----
@@ -2117,7 +2117,7 @@ https://docs.djangoproject.com/en/4.2/topics/auth/default/#module-django.contrib
2117
2117
which clears down the user's session and redirects them to a page of our choice:
2118
2118
2119
2119
[role="sourcecode small-code"]
2120
- .src/accounts/urls.py (ch19l052 )
2120
+ .src/accounts/urls.py (ch19l050 )
2121
2121
====
2122
2122
[source,python]
2123
2123
----
0 commit comments