First thing is to install django-star-rating on your machine. To do so, you could just use command
pip install django-star-rating
If you're using virtualenv then you have to first activate virtualenv and install in it. Since I was using PyCharm which is a hasslefree IDE, I just installed the package via Project Interpreter on Settings.
After installing the package, you have to include it in INSTALLED_APPS. For this, navigate to the project's root directory and to the subdirectory with same name as project. There you will find settings.py file. In settings.py you will see INSTALLED_APPS. Just include 'star_ratings' in INSTALLED_APPS as
INSTALLED_APPS = [ #..... 'star_ratings' ]
After above process, head to the urls.py file which is in same directory as settings.py. Then include url as
urlpatterns = [ url(r'^ratings/', include('star_ratings.urls', namespace='ratings')) ]
After this you can head to any template within the project you want to use this rating feature. Then within the template include
{% load ratings %} <html> <link rel="stylesheet" href="{% static 'star-ratings/css/star-ratings.css' %}"> <script type="text/javascript" src="{% static 'star-ratings/js/dist/star-ratings.min.js' %}"></script> </html>
CSS and Js(JavaScript) files required for star based ratings is included by above code.
Then to actually use rating system do
<body> {% ratings objects %} </body>
Here, object generally refers to the things that need to be rated.
For eg. you have an model named Book that include all the details about books. And you want to rate that book. Then if books instance is passed as book than
{% ratings book %}
would be enough to rate the book among 5 stars