@staticmethod
def _check_url_prefix(url_prefix):
    """check if url_prefix is legal"""
    if isinstance(url_prefix, str):
        if not url_prefix.startswith('/'):
            url_prefix = '/' + url_prefix
    else:
        raise TypeError('url_prefix must be a str type, not %s type' % type
            (url_prefix).__name__)
    return url_prefix
