core.files.storage.Storage.get_modified_time()

get_modified_time(name) [source] New in Django 1.10. Returns a datetime of the last modified time of the file. For storage systems unable to return the last modified 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.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.get_available_name()

get_available_name(name, max_length=None) [source] Returns a filename based on the name parameter that’s free and available for new content to be written to on the target storage system. The length of the filename will not exceed max_length, if provided. If a free unique filename cannot be found, a SuspiciousFileOperation exception will be raised. If a file with name already exists, an underscore plus a random 7 character alphanumeric string is appended to the filename before the extension.

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.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.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.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

class Storage [source] The Storage class provides a standardized API for storing files, along with a set of default behaviors that all other storage systems can inherit or override as necessary. Note When methods return naive datetime objects, the effective timezone used will be the current value of os.environ['TZ']; note that this is usually set from Django’s TIME_ZONE. accessed_time(name) [source] Returns a naive datetime object containing the last accessed time of the file. For stora