I've configured both MEDIA_ROOT
and MEDIA_URL
and this works perfectly fine.
My MEDIA files stored in a directory named /media/
, now I want to store newly uploaded files to a new directory (for ex. /media2/) without breaking previous files.
For example I had a Book model like this:
class Book(models.Model):
# name
# author
cover = models.ImageField()
Now imagine I have 500 objects of Book model, so each cover has a path and url like this:
url: http://example.com/media/books/thumb.jpg
path: /home/myproj/media/books/thumb.jpg
Now, I want to store covers for my newly created books in another directory, for ex. :
url: http://example.com/media2/books/thumb.jpg
path: /home/myproj/media2/books/thumb.jpg
without breaking previous 500 books!
How can I achieve this ?! (Django 3.1.2
)