Forums

Endless_pagination Using in Django 1.10

Django 1.10 doesn't support "django.core.context_processors.request", I start to use endless_pagination, but I have a problem with templatetags. Does someone know how can I edit below line to work with Django 1.10

page_number = utils.get_page_number_from_request( context['request'], querystring_key, default=default_number)

Here you go: http://stackoverflow.com/questions/38709985/where-has-django-core-context-processors-request-gone-in-django-1-10

Thanks for your response, I change it to django.template.context_processors but It doesn't work.

It shows this error

'WSGIRequest' object has no attribute 'REQUEST'

and I found that i should change below line, but I am not a professional python programmer and I don't know how can I change this code.

page_number = utils.get_page_number_from_request( context['request'], querystring_key, default=default_number)

Why not just use the request that is passed into the view instead:

page_number = utils.get_page_number_from_request(request, querystring_key, default=default_number)

When I use just request it says that

"global name 'request' is not defined"

request is the normal name people give to the request object that's passed into a Django view, but perhaps you've given it a different name. What's the definition of your view function?

django_endless_pagination is abandoned. The last update to it was 4 years ago, so it's very unlikely that you'll get it to work with Django 1.10. Try a different pagination library.

It is not my code it is the packages codes and I only try to edit it that Maybe it works with django 1.10 I couldn't find the package that works with django 1.10 !!!

How about just the pagination that django 1.10 provides natively.

I found Endless_pagination Version 3 (django-el-pagination) And it works perfect, Thanks for everybody helps me