[Fixed]-Django limit voting to once a day

1👍

Just add a field to keep track of the last time the user voted.

Example,

last_vote_time = models.DateTimeField()

and in views.py, check if last_vote_time has a 24 hour difference from the current time.

This should help. Tell me if you need some code. But, I think you’ll be able to do it.

Leave a comment