from os.path import join
from os import makedirs
from django.conf import settings


def make_file_id(file_data):
    return str(abs(hash(file_data)))


def get_file_location(file_name, file_id):
    path = join(settings.MEDIA_ROOT, 'tmp')
    path = join(path, str(file_id))
    try:
        makedirs(path)
    except:
        pass
    return join(path, file_name)


def get_file_url(file_name, file_id):
    path = join(settings.MEDIA_URL, 'tmp')
    path = join(path, str(file_id))
    return join(path, file_name)

@@ -79,38 +79,246 @@
 ngs%0A
-%0A%0Adef make_file_id(file_data):
+from datetime import datetime%0Aimport time%0A%0A%0Adef make_file_id(file_data):%0A    timestamp = datetime.now()%0A    timestamp = time.mktime(timestamp.timetuple()) * 1e3 + timestamp.microsecond / 1e3%0A    timestamp = '%7B%7D'.format(timestamp).encode()
 %0A   
@@ -347,16 +347,28 @@
 ile_data
+ + timestamp
 )))%0A%0A%0Ade

Improve the file id hash