I have to show realtime leaderboard for 1,00,000 users , so How can I implement it in my Django webapp ,
If I am insert my data through Loop it will take too much time and load , so Can you please tell me what will the best approach for this
Here you can Check my code
Models.py
def Index(request):
a=Score.objects.all()
highscore_lb=CompetitionRankingLeaderboard('sdfs')
for index in a:
highscore_lb.rank_member(index.name, index.score)
b=highscore_lb.all_leaders()
return render(request,'index.html',{'b':b})
I have to show realtime leaderboard for 1,00,000 users , so How can I implement it in my Django webapp ,
If I am insert my data through Loop it will take too much time and load , so Can you please tell me what will the best approach for this Here you can Check my code Models.py
`class Score(models.Model): name=models.CharField(max_length=211) score=models.IntegerField()
def str(self): return self.name `
Views.py
def Index(request): a=Score.objects.all() highscore_lb=CompetitionRankingLeaderboard('sdfs') for index in a: highscore_lb.rank_member(index.name, index.score) b=highscore_lb.all_leaders() return render(request,'index.html',{'b':b})