Implementing the Like widget
Websites in general, and most commonly those with a social component, often have integrated Facebook, Twitter, and Google+ widgets to like and share content. In this recipe, we will guide you through the building of a similar Django functionality that will save information in your database whenever a user likes something. You will be able to create specific views based on the things that people liked on your website. We will similarly create a Like widget with a two-state button and badge showing the number of total likes.
The following screenshot shows the inactive state, where you can click on a button to activate it:
The following screenshot shows the active state, where you can click on a button to deactivate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access