#NEWLINE# def _get_upload_name( self , filename ) : #NEWLINE# #INDENT# 'Returns an upload_to path to a new file' #NEWLINE# import hashlib #NEWLINE# import random #NEWLINE# while True : #NEWLINE# #INDENT# hasher = hashlib . md5 ( ) #NEWLINE# hasher . update ( str ( random . random ( ) ) ) #NEWLINE# filepath = ( ( ( 'infrastructure/' + hasher . hexdigest ( ) ) + '__' ) + filename ) #NEWLINE# fullpath = ( settings . MEDIA_ROOT + filepath ) #NEWLINE# if ( not default_storage . exists ( fullpath ) ) : #NEWLINE# #INDENT# return filename