def parse_redirect_params(redirect_str):
    """
    Parse a redirect string into it's url reverse key and optional kwargs
    """
    if not redirect_str:
        return None, None
    redirect_key = redirect_str
    redirect_kwargs = {}
    redirect_key_parts = redirect_str.split("|")
    if len(redirect_key_parts) == 2:
        redirect_key, redirect_kwargs_spec = redirect_key_parts
        redirect_kwargs = dict([redirect_kwargs_spec.split("=")])
    return redirect_key, redirect_kwargs