Привет всем. На сайте вывожу список новостей (news) через темплейттег. Как сделать пагинацию? Мне нужно прописывать пагинатор во вьюхе приложения news или же в файле news_tags.py?
news_tags.py
from django import template
from news.models import NewsEntry
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import get_object_or_404, render_to_response
register = template.Library()
@register.inclusion_tag('news/titles.html')
def news_title(news):
entries = NewsEntry.objects.all()
return {
'entries': entries
}