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

core.files.storage.get_storage_class()

get_storage_class(import_path=None) [source] Returns a class or module which implements the storage API. When called without the import_path parameter get_storage_class will return the current default storage system as defined by DEFAULT_FILE_STORAGE. If import_path is provided, get_storage_class will attempt to import the class or module from the given path and will return it if successful. An exception will be raised if the import is unsuccessful.

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.

core.files.storage.FileSystemStorage.location

location Absolute path to the directory that will hold the files. Defaults to the value of your MEDIA_ROOT setting.

core.files.storage.get_available_name()

get_available_name(name, max_length=None) Returns a filename that is available in the storage mechanism, possibly taking the provided filename into account. The name argument passed to this method will have already cleaned to a filename valid for the storage system, according to the get_valid_name() method described above. The length of the filename will not exceed max_length, if provided. If a free unique filename cannot be found, a SuspiciousFileOperation exception is raised. If a file wit

core.files.storage.FileSystemStorage.base_url

base_url URL that serves the files stored at this location. Defaults to the value of your MEDIA_URL setting.

core.files.storage.FileSystemStorage

class FileSystemStorage(location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None) [source] The FileSystemStorage class implements basic file storage on a local filesystem. It inherits from Storage and provides implementations for all the public methods thereof. location Absolute path to the directory that will hold the files. Defaults to the value of your MEDIA_ROOT setting. base_url URL that serves the files stored at this location. Defaults to the

core.files.storage.FileSystemStorage.directory_permissions_mode

directory_permissions_mode The file system permissions that the directory will receive when it is saved. Defaults to FILE_UPLOAD_DIRECTORY_PERMISSIONS. Note The FileSystemStorage.delete() method will not raise an exception if the given file name does not exist.

core.files.images.ImageFile.width

width Width of the image in pixels.

core.files.images.ImageFile

class ImageFile(file_object) [source] Django provides a built-in class specifically for images. django.core.files.images.ImageFile inherits all the attributes and methods of File, and additionally provides the following: width Width of the image in pixels. height Height of the image in pixels.