# The tag from django import template register = template.Library() @register.inclusion_tag('paginator.html', takes_context=True) def paginator(context): return { 'page_obj': context['page_obj'], 'paginator': context['paginator'], 'is_paginated': context['is_paginated'], 'object_list': context['object_list'], } # An example paginator.html {% if is_paginated %}