tango_with_django_2
tango_with_django_2 copied to clipboard
Typo on page 275 & 276
Hi,
As I was reading and implementing the book, I noticed a small typo on pages 275 and 276 (images are attached).
We want to display the list of users registered with rango and therefore in list_profiles.html
write
...
<div class="container">
<div class="row">
{% if user_profile_list %}
<div class="panel-body">
<div class="list-group">
{% for list_user in user_profile_list %}
...
But on the next page, while creating a view for it in views.py
, the code in the book adds the profiles under the key 'userprofile_list' instead of 'user_profile_list.
class ListProfilesView(View):
@method_decorator(login_required)
def get(self, request):
profiles = UserProfile.objects.all()
return render(request, 'rango/list_profiles.html', {'userprofile_list': profiles})
This leads to an error. I hope you fix it. P.S: The book has been great. Love from India!
Screenshots of the book
- Page 275
- Page 276