def add_page_num(request, page):
    """
    Update page number variable to a url that may or may not have other GET variables
    """
    vars = request.GET.copy()
    vars["page"] = page
    var_string = "&".join([f"{k}={v}" for k, v in vars.items()])
    return f"{request.path}?{var_string}"