def get_page_limit(request, default):
    """Return page and limit as integers."""
    try:
        limit = int(request.GET.get('limit', default))
    except ValueError:
        limit = default
    limit = min(max(10, limit), 2000)
    try:
        page = int(request.GET.get('page', 1))
    except ValueError:
        page = 1
    page = max(1, page)
    return page, limit
