19👍
✅
You should import it first:
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
2👍
You can not use PageNotAnInteger without importing it.
So please import it first.
from django.core.paginator import PageNotAnInteger
If you need EmptyPage as well:
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
- [Django]-Managing a pool of connections to a hosted Elastic Search provider
- [Django]-Django+MySQL – "Authentication plugin 'caching_sha2_password' cannot be loaded"
- [Django]-How to train a Keras model in Django: weak reference to 'gevent._local.local' object error
- [Django]-Collectstatic command excluding nested directories and files
- [Django]-Django modelfield, how do I get the actual value?
Source:stackexchange.com