try:
        news_page = paginator.page(page)
    except (EmptyPage, InvalidPage):
        news_page = paginator.page(paginator.num_pages)