DRF uses paging function Error: unorderedobjectlistwarning

UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class ‘myapp.models.Power’> QuerySet.
paginator = self.django_paginator_class(queryset, page_size)

The reason is that you are not sorting.

(a) add ordering to the design of the model

class test(models.Model):

    class Meta:

(b) Add order_by to the query set for sorting

Read More: