def __init__(self, *args, **kwargs): from restthumbnails import defaults self.storage = defaults.storage_backend() self.source_storage = defaults.source_storage_backend() super(ThumbnailFile, self).__init__(*args, **kwargs)
def sendfile(request, thumbnail, **kwargs): from restthumbnails import defaults storage = defaults.storage_backend() return serve(request, thumbnail.name, storage.location)
def setUp(self): from restthumbnails import defaults self.storage = defaults.storage_backend() self.storage.cleanup()