Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
318 B
1
Indexable
Never
def subir_fichero(instance, filename):
	todays_date = datetime.now()
	path = "uploads/{}/{}/{}/".format(todays_date.year, todays_date.month, todays_date.day)
	extension = "." + filename.split('.')[-1]
	stringId = str(uuid.uuid4())
	filename_reformat = stringId + extension
	return os.path.join(path, filename_reformat)