core.files.storage.Storage.get_created_time()

get_created_time(name) [source] New in Django 1.10. Returns a datetime of the creation time of the file. For storage systems unable to return the creation time this will raise NotImplementedError. If USE_TZ is True, returns an aware datetime, otherwise returns a naive datetime in the local timezone.

core.files.storage.Storage.open()

open(name, mode='rb') [source] Opens the file given by name. Note that although the returned file is guaranteed to be a File object, it might actually be some subclass. In the case of remote file storage this means that reading/writing could be quite slow, so be warned.

core.files.storage.Storage.listdir()

listdir(path) [source] Lists the contents of the specified path, returning a 2-tuple of lists; the first item being directories, the second item being files. For storage systems that aren’t able to provide such a listing, this will raise a NotImplementedError instead.

core.files.storage.Storage.exists()

exists(name) [source] Returns True if a file referenced by the given name already exists in the storage system, or False if the name is available for a new file.

core.files.storage.Storage.accessed_time()

accessed_time(name) [source] Returns a naive datetime object containing the last accessed time of the file. For storage systems that aren’t able to return the last accessed time this will raise NotImplementedError instead. Deprecated since version 1.10: Use get_accessed_time() instead.

core.files.storage.Storage.delete()

delete(name) [source] Deletes the file referenced by name. If deletion is not supported on the target storage system this will raise NotImplementedError instead

core.files.storage.Storage.created_time()

created_time(name) [source] Returns a naive datetime object containing the creation time of the file. For storage systems that aren’t able to return the creation time this will raise NotImplementedError instead. Deprecated since version 1.10: Use get_created_time() instead.

core.files.storage.Storage.get_accessed_time()

get_accessed_time(name) [source] New in Django 1.10. Returns a datetime of the last accessed time of the file. For storage systems unable to return the last accessed time this will raise NotImplementedError. If USE_TZ is True, returns an aware datetime, otherwise returns a naive datetime in the local timezone.

core.files.storage.Storage.generate_filename()

generate_filename(filename) [source] New in Django 1.10. Validates the filename by calling get_valid_name() and returns a filename to be passed to the save() method. The filename argument may include a path as returned by FileField.upload_to. In that case, the path won’t be passed to get_valid_name() but will be prepended back to the resulting name. The default implementation uses os.path operations. Override this method if that’s not appropriate for your storage.

core.files.storage.FileSystemStorage.file_permissions_mode

file_permissions_mode The file system permissions that the file will receive when it is saved. Defaults to FILE_UPLOAD_PERMISSIONS.