scipost.storage module

class scipost.storage.SecureFileStorage(location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None)[source]

Bases: django.core.files.storage.FileSystemStorage

Inherit default FileStorage system to prevent files from being publicly accessible from a server location that is opened without this permission having been explicitly given.

location

This method determines the storage location for a new file. To secure the file from ‘the public’, we’ll store it outside the publicly accessible MEDIA_ROOT folder.

This also means you need to explicitly handle the file reading/opening!

base_url