I have a Django model with
...
image = models.ImageField(default=None, upload_to=settings.PHOTO_UPLOAD_TO)
...
I have changed the value of settings.PHOTO_UPLOAD_TO
, but the files have remained where they were, and the database entries also don't seem to have changed. A newly added image is placed in the correct new location, but not the old ones. Is it an expected behaviour? Is there a way to migrate the image locations? I would like to slightly change the directory/URL structure of my project.
The path of a
FileField
/ImageField
is stored relative toMEDIA_ROOT
, so if you want to move the files to the newupload_to
folder, you're gonna need to put that in your migration yourself (like you suggested).