title: Django unique filename method
body: <p>I am looking for the method Django uses to generate unique filename when we upload a file.</p>
  
  <p>For example, if I upload a file called <code>test.csv</code> twice in the same directory, the first one will be saved as <code>test.csv</code> and the second file will be saved as <code>test_2.csv</code>. I already tried to find how Django manages that, but I only found <code>django.utils.text.get_valid_filename</code> which could be useful, but that not what I am looking for...</p>
  
  <p>I already saw <a href="https://stackoverflow.com/questions/2673647/enforce-unique-upload-file-names-using-django">other</a> <a href="https://stackoverflow.com/questions/2680391/in-django-changing-the-file-name-of-uploading-file">topics</a> with random naming solution, that not what I am looking for here :) I really trying to understand how Django manage that problem.</p>