A wrapper around the Paginator that takes config data
    :param iter: Query object or any iterables
    :param kwargs:
        - page: current page
        - per_page: max number of items per page
        - total: Max number of items. If not provided, it will use the query to count
        - padding: Number of elements of the next page to show
        - callback: a function to callback on each item being iterated.
        - static_query: bool - When True it will return the query as is, without slicing/limit. Usally when using the paginator to just create the pagination.
    :return: Paginator

def paginate(iter, **kwargs):
    """
     A wrapper around the Paginator that takes config data
    :param iter: Query object or any iterables
    :param kwargs:
        - page: current page
        - per_page: max number of items per page
        - total: Max number of items. If not provided, it will use the query to count
        - padding: Number of elements of the next page to show
        - callback: a function to callback on each item being iterated.
        - static_query: bool - When True it will return the query as is, without slicing/limit. Usally when using the paginator to just create the pagination.
    :return: Paginator
    """
    kwargs.setdefault("page", int(request.args.get('page', 1)))
    kwargs.setdefault("per_page", int(config("PAGINATION_PER_PAGE", 1)))
    kwargs.setdefault("padding", int(config("PAGINATION_PADDING", 0)))
    return Paginator(iter, **kwargs)