@classmethod
def get_base_path(cls, script_prefix, api_prefix):
    """Determine an appropriate value for ``basePath`` based on the SCRIPT_NAME and the api common prefix.

        :param str script_prefix: script prefix as defined by django ``get_script_prefix``
        :param str api_prefix: api common prefix
        :return: joined base path
        """
    if script_prefix and script_prefix.endswith('/'):
        script_prefix = script_prefix[:-1]
    if not api_prefix.startswith('/'):
        api_prefix = '/' + api_prefix
    base_path = script_prefix + api_prefix
    if base_path and base_path.endswith('/'):
        base_path = base_path[:-1]
    if not base_path.startswith('/'):
        base_path = '/' + base_path
    return base_path
