def get_random_filename(instance, filename):
folder = settings.UPLOADS_ROOT<EOL>ext = filename.split('<STR_LIT:.>')[-<NUM_LIT:1>]<EOL>filename = '<STR_LIT>'.format(str(uuid4()), ext)<EOL>return os.path.join(folder, filename)<EOL>
Generates random filename for uploading file using uuid4 hashes
You need to define UPLOADS_ROOT in your django settings
something like this
UPLOADS_ROOT = rel(MEDIA_ROOT, 'uploads')