Django order_by random in Postgres
Do NOT use order_by('?') if your table size is big.
Entry.objects.order_by('?')
More about this:
http://www.peterbe.com/plog/getting-random-rows-postgresql-django
Written by Nam Ngo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors