Skip to content

How to configure it for around 1,00,000 users #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Abhi-khandelwal opened this issue Aug 7, 2018 · 1 comment
Open

How to configure it for around 1,00,000 users #60

Abhi-khandelwal opened this issue Aug 7, 2018 · 1 comment

Comments

@Abhi-khandelwal
Copy link

Abhi-khandelwal commented Aug 7, 2018

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})

@czarneckid
Copy link
Member

You can use the rank_members method to rank multiple members at once. For example, https://github.com/agoragames/leaderboard-python/blob/master/test/leaderboard/leaderboard_test.py#L494-L497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants