What's the best way to rename photos with a unique filename on the server as they are uploaded, using django? I want to make sure each name is used only once. Are there any pinax apps that can do this, perhaps with GUID?
Python – Enforce unique upload file names using django
djangofile-renamepinaxpython
Best Answer
Use uuid. To tie that into your model see Django documentation for FileField upload_to.
For example in your models.py define the following function:
Then, when defining your FileField/ImageField, specify
get_file_path
as theupload_to
value.