def format_prefix(prefix):
    """
    Format url path prefix, ensure '/' in the begining.
    """
    prefix = '' if prefix is None else prefix
    prefix = prefix if prefix.startswith('/') else '/%s' % prefix
    return prefix
