a year ago
Hello, I want to add user's avatars on volume then show them on my website, this is my settings.py:
STATIC_URL = '/static/'
MEDIAROOT = os.path.join(os.path.dirname(BASEDIR), 'media')
According to https://docs.railway.com/guides/volumes#relative-paths I filled 'Mount Path' like this: "/app/media"
After I upload my avatar everything seems to work, I can see my picture at url:
MYSERVERURL/media/avatar.jpg
but after I redeploy my backend this file is gone
5 Replies
a year ago
walk me through your process here. You have your volume mounted to /app/media, you’re uploading an image and saving it to /media/avatar.jpg, and on redeploy the avatar is gone?
a year ago
Saving images is best done in a cloud bucket rather than in a Railway Volume for ease of external access
a year ago
Aside from that, you’ve mounted your volume to /app/media but you’re saving images to /media. The images are not being saved to the bucket
a year ago
!s
Status changed to Solved adam • over 1 year ago