I am looking for the method Django uses to generate unique filename when we upload a file.
For example, if I upload a file called test.csv
twice in the same directory, the first one will be saved as test.csv
and the second file will be saved as test_2.csv
. I already tried to find how Django manages that, but I only found django.utils.text.get_valid_filename
which could be useful, but that not what I am looking for...
I already saw other topics with random naming solution, that not what I am looking for here :) I really trying to understand how Django manage that problem.