1👍
There is a random ordering built into .order_by()
using the string '?'
:
https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.order_by
In your case it would be:
Article.objects.order_by('?')
After ordering them, you might then filter out the top X records and again order them by rating.
Source:stackexchange.com