O'Reilly logo

Learning Django Web Development by Ratan Kumar, Sanjeev Jaiswal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying the most followed user

After we have implemented the feature for following users, we can move ahead with a new page design where we will list the most followed user. The logic of this page can be reused to design the page that has the highest number of comments.

The basic components for this page design are:

  • View: The users.html file
  • Controller: The most followed user
  • URL mapping

Add the following content in the view.html file:

 {% extends "base.html" %} {% load staticfiles %} {% block navbar %} <p class="navbar-text navbar-right"> <span class="glyphicon glyphicon-user"></span> {{ user.username }} </p> {% endblock %} {% block content %} <div class="row clearfix"> <div class="col-md-12 column"> {% for userFollower in userFollowers %} <div ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required