Hi everyone,
[Description]
I have Django app that uses PostgreSQL, in my DB, the admin can set Images for the field in Django model:
image = models.FileField(_(“Photo:”), upload_to=‘test_images/’, null=True, blank=True)
So, my DB saves only references to images like “test_images/image_2.svg” and it is available via a link:
“mysite.com/media/test_images/image.svg”
in setting.py I have the following code:
MEDIA_URL = ‘/media/’
MEDIA_ROOT = os.path.join(BASE_DIR, ‘user-media’)
[Issue]
It works well but the problem is that I lose these images after each deployment, I know why it happens. So, I bought the persistent disk in order to save the images there, and set the path there (Mount path = /test_images/) but it doesn’t work.
I have read the tonne of similar articles in this community forum and of course these docs:
Disks | Render Docs and deploy-django#static-files
However I didn’t get the answer on how to configure my app so that images would be uploaded and used from this persistent disk.
I am a newbie in Django and probably, it is obvious for most power users however I am looking for some help here.
P.s. And does anybody know how to see all files in a persistent disk? Is there any explorer or anything else?