Relative Content

Tag Archive for pythondjangodjango-viewsdjango-forms

Unique submit btn for each user – django

I have a Like button for my posts which users can like the posts or not, which means if a user clicked on the button for the first time the post will be liked by the user and for the second time it will be unliked by the user.
just like Facebook or twitter and etc. I tried a lot to do this but my problem is ” when user click on the button it will add one like on the counter and if a user likes again it will count 2 likes for the post by a user!
Anyway, how we can make the likes unique? Each user should be able to like any post just once and if they clicked again it means they unliked a post.