I'm trying to create migrations of a project which uses Rest Framework pagination .
But I'm getting error as Attribution error: 'module' object has no attribute BasePaginationSerializer
. I have tried uninstalling-resinstalling the said versions of Python, Django and RestFramework. But I still get that error.
Here's the screenshot of terminal showing error.
Here's a chunk of the code present in paginator.py
import urlparse
from django.core.paginator import EmptyPage, Page, PageNotAnInteger, Paginator
from django.utils.http import urlencode
from rest_framework import serializers, pagination
class CustomPaginationSerializer(pagination.BasePaginationSerializer):#Here it shows the error.
meta = MetaSerializer(source='*')
results_field = 'objects'
Can someone help me out in getting this issue resolved?
Info: - Here's the project which I'm trying to build. https://github.com/mozilla/zamboni
Django Rest Framework
doesn't provide anything like BasePaginationSerializer
, that's why you're getting an error - because it doesn't exist. You probably want to use BasePagination
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.