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
def hash_file(file, block_size=65536): | |
hasher = hashlib.md5() | |
for buf in iter(partial(file.read, block_size), b''): | |
hasher.update(buf) | |
return hasher.hexdigest() | |
def upload_to(instance, filename): | |
""" |