Override the url() method to cause an error if the file does not exist:
from django.core.files.storage import FileSystemStorage class CustomFileSystemStorage(FileSystemStorage): def url(self, name): if not self.exists(name): raise ValueError('"%s" does not exist.' % name) return super(CustomFileSystemStorage, self).url(name)
In your settings.py file:
DEFAULT_FILE_STORAGE = 'mymodule.CustomFileSystemStorage'
source share