如何为匿名用户创建Django赞按钮? [英] How to create Django like button for anonymous users?
本文介绍了如何为匿名用户创建Django赞按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Django,而且我的网站没有用户个人资料,因此所有人都是匿名的。我想实施一个喜欢系统。如何限制用户只喜欢一次。谢谢。
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.
推荐答案
如果您无法识别用户,那么最好的办法是将此信息存储在浏览器cookie 或 HTML5本地存储。 (我不建议您使用Flash Cookie,因为有关它们的争论由来已久,而且更难以实施)
If you don't have any way of identifying your users then your best bet is to store this info in a browser cookie or HTML5 local storage. (I don't advise using flash cookies since there is a long debate about them and they are harder to implement)
这篇关于如何为匿名用户创建Django赞按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文