Answer the question
In order to leave comments, you need to log in
ImageField not to change names?
I have a field in the model: icon = models.ImageField(upload_to='icon')
In my situation, many entries can have the same icon. When creating an entry and adding an icon to it through the admin panel, if there is no such icon, it does not change the name and everything is as it should be. When I add it with the same icon, the script renames it and it turns out that there is a duplicate on the server.
How to make it so that it does not change the name of the icon, and well, if there is already one, let it just overwrite it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question