tango_with_django_2 icon indicating copy to clipboard operation
tango_with_django_2 copied to clipboard

Typo on page 275 & 276

Open mdvsh opened this issue 4 years ago • 0 comments

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

  1. Page 275 image
  2. Page 276 image

mdvsh avatar Mar 05 '20 13:03 mdvsh