def __init__(self, location=None, base_url=None, file_permissions_mode=None,
directory_permissions_mode=None):
self._file_path = ''
self._file_name = ''
if os.path.isfile(location):
# Separate the path from the filename
self._file_path, self._file_name = os.path.split(location)
else:
# This class won't work if `location` doesn't point to an actual file
raise IOError('Path should point to an existing file')
# Pass in the folder so this acts like a typical FileSystemStorage that needs a path
super().__init__(
self._file_path,
base_url,
file_permissions_mode,
directory_permissions_mode
)
评论列表
文章目录