How to create Django like button for anonymous users?

前端 未结 3 1726
你的背包
你的背包 2021-01-21 06:37

I am using Django and my website has no user profiles so all are anonymous. I want to implement a \'like\' system. How do I restrict a user to like only once. Thanks.

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 06:43

    You can't 100% restrict multiple votes, but you can make it very difficult for a regular user, by using:

    • a cookie
    • a DB entry with the voter's IP

提交回复
热议问题