1 from hashlib import sha1
2 from django.core.files.uploadedfile import UploadedFile
5 class ExistingFile(UploadedFile):
7 def __init__(self, path, *args, **kwargs):
9 return super(ExistingFile, self).__init__(*args, **kwargs)
11 def temporary_file_path(self):
20 for piece in iter(lambda: f.read(1024*1024), ''):
22 return sha.hexdigest()