Django model object hit counting

In this article, we are going to make a project in which we will see how to make a Django table that will store all the data of hit count and detailed data of hit. It can be used generate useful reports. So, let's get started.

Setup your and install the django-hitcount module

pip install django-hitcount


In, add the following line −

INSTALLED_APPS+ = ['hitcount']

Here we added this library as an app in the project.

Run the following commands −

python makemigrations
python migrate

Here, we create migrations and then we migrate it.

That's all. This library will create a table that will store all the data.


Go to and login

Hit counts and Hits contain what we wanted, you can explore other two.

Updated on: 25-Aug-2021


Kickstart Your Career

Get certified by completing the course

Get Started