def get_data_from_context(context):
    """Get the django paginator data object from the given *context*.
    The context is a dict-like object. If the context key ``endless``
    is not found, a *PaginationError* is raised.
    """
    try:
        return context['endless']
    except KeyError:
        raise Exception('Cannot find endless data in context.')