class documentation

class StaticFilesStorage(FileSystemStorage):

Known subclasses: django.contrib.staticfiles.storage.ManifestStaticFilesStorage

View In Hierarchy

Standard file system storage for static files.

The defaults for location and base_url are STATIC_ROOT and STATIC_URL.

Method __init__ Undocumented
Method path Return a local filesystem path where the file can be retrieved using Python's built-in open() function. Storage systems that can't be accessed using open() should not implement this method.
Instance Variable base​_location Undocumented
Instance Variable location Undocumented

Inherited from FileSystemStorage:

Method get​_created​_time Return the creation time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.
Constant OS​_OPEN​_FLAGS Undocumented
Method ​_clear​_cached​_properties Reset setting based property values.
Method ​_datetime​_from​_timestamp If timezone support is enabled, make an aware datetime object in UTC; otherwise make a naive one in the local timezone.
Method ​_open Undocumented
Method ​_save Undocumented
Method ​_value​_or​_setting Undocumented
Method delete Delete the specified file from the storage system.
Method exists Return 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.
Method get​_accessed​_time Return the last accessed time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.
Method get​_modified​_time Return the last modified time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.
Method listdir List the contents of the specified path. Return a 2-tuple of lists: the first item being directories, the second item being files.
Method size Return the total size, in bytes, of the file specified by name.
Method url Return an absolute URL where the file's contents can be accessed directly by a web browser.
Instance Variable ​_base​_url Undocumented
Instance Variable ​_directory​_permissions​_mode Undocumented
Instance Variable ​_file​_permissions​_mode Undocumented
Instance Variable ​_location Undocumented
Property base​_url Undocumented
Property directory​_permissions​_mode Undocumented
Property file​_permissions​_mode Undocumented

Inherited from Storage (via FileSystemStorage):

Method generate​_filename Validate the filename by calling get_valid_name() and return a filename to be passed to the save() method.
Method get​_alternative​_name Return an alternative filename, by adding an underscore and a random 7 character alphanumeric string (before the file extension, if one exists) to the filename.
Method get​_available​_name Return a filename that's free on the target storage system and available for new content to be written to.
Method get​_valid​_name Return a filename, based on the provided filename, that's suitable for use in the target storage system.
Method open Retrieve the specified file from storage.
Method save Save new content to the file specified by name. The content should be a proper File object or any Python file-like object, ready to be read from the beginning.
def __init__(self, location=None, base_url=None, *args, **kwargs):
def path(self, name):
Return a local filesystem path where the file can be retrieved using Python's built-in open() function. Storage systems that can't be accessed using open() should not implement this method.