core.files.storage.get_valid_name()

get_valid_name(name) Returns a filename suitable for use with the underlying storage system. The name argument passed to this method is either the original filename sent to the server or, if upload_to is a callable, the filename returned by that method after any path information is removed. Override this to customize how non-standard characters are converted to safe filenames. Changed in Django 1.9: In older versions, this method was not called when upload_to was a callable. The code provi

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

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

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

class DefaultStorage [source] DefaultStorage provides lazy access to the current default storage system as defined by DEFAULT_FILE_STORAGE. DefaultStorage uses get_storage_class() internally.

core.files.images.ImageFile.width

width Width of the image in pixels.