Created
October 7, 2015 20:30
-
-
Save dvl/ebbe27b09b2c16b1a136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DummyStorage(FileSystemStorage): | |
def _open(self, name, mode='rb'): | |
try: | |
return File(open(self.path(name), mode)) | |
except IOError: | |
name = '/home/andre/Imagens/placeholder.jpg' | |
return File(open(name), mode) | |
DEFAULT_FILE_STORAGE = 'geral.custom_settings.DummyStorage' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment