def invalid_query_params(dj_request, valid_params):
    """Helper routine.  Determines if there are invalid query parameters
    in the Django request.

    Parameters
    ----------
    dj_request:      Django request object.
    valid_params:    A list of valid query parameter names.

    Returns
    -------
    A dictionary with keys being the invalid query parameter names, and the values
    of the keys being the string "Invalid query parameter."

    """
    extra_params = set(dj_request.GET.keys()) - set(valid_params)
    return {p: 'Invalid query parameter.' for p in extra_params}