How to deploy image for django application

aydinyilmazeclawPRO

10 months ago

I deployed my website. I used github. However, even though I can complete the form to update profile photos, I can not see the picture. Can you help me??

0 Replies

aydinyilmazeclawPRO

10 months ago

118c0d3a-2e06-4eee-b22c-ab02d2947048


10 months ago

im sorry but "I can not see the picture" is not super helpful, please provide actual errors


aydinyilmazeclawPRO

10 months ago

I am uploading a profile photo but it doesnt work

1266457528305193000
1266457537427804200


aydinyilmazeclawPRO

10 months ago

this is related database

1266457915196313600


aydinyilmazeclawPRO

10 months ago

postgres database


10 months ago

what errors are you getting though? 404?


aydinyilmazeclawPRO

10 months ago

actually I dont take any error, but profile photos of users can not be seen


aydinyilmazeclawPRO

10 months ago

is it about github


aydinyilmazeclawPRO

10 months ago

or railway


10 months ago

there are errors somewhere, please provide them


10 months ago

check your dev tools for your browser


aydinyilmazeclawPRO

10 months ago

ok let me look


aydinyilmazeclawPRO

10 months ago

btw. I didn't create a MongoDB


aydinyilmazeclawPRO

10 months ago

I only have postgres


aydinyilmazeclawPRO

10 months ago

is it enough


10 months ago

what does mongo have to do with this lol


aydinyilmazeclawPRO

10 months ago

Can I use github also for profile pictures


aydinyilmazeclawPRO

10 months ago

🙂


10 months ago

please provide errors


aydinyilmazeclawPRO

10 months ago

Ok, I though Mongo is for files and images


aydinyilmazeclawPRO

10 months ago

1266459947386798000


aydinyilmazeclawPRO

10 months ago

this is the errros from console


aydinyilmazeclawPRO

10 months ago

yes it seems that it is 404


10 months ago

what is your volume's mount point


aydinyilmazeclawPRO

10 months ago

I am looking now


aydinyilmazeclawPRO

10 months ago

MEDIAROOT = os.path.join(BASEDIR, 'media')
MEDIAURL = '/media/' this is settings.py and related class class Customer(models.Model): user = models.OneToOneField(User, ondelete=models.CASCADE)
profilephoto = models.ImageField(uploadto='profile_photos/', null=True, blank=True)


10 months ago

that is useful information, but that doesn't actually answer my question


10 months ago

do you not have a volume?


aydinyilmazeclawPRO

10 months ago

1266462902060318700


aydinyilmazeclawPRO

10 months ago

as I understand you are asking this


aydinyilmazeclawPRO

10 months ago

I don't have this in my project


aydinyilmazeclawPRO

10 months ago

I have two files, postgres and proejct


10 months ago

go ahead and mount a volume to /app/media


10 months ago

those are services, not files


aydinyilmazeclawPRO

10 months ago

1266463289374802200


aydinyilmazeclawPRO

10 months ago

sorry services


aydinyilmazeclawPRO

10 months ago

my app name yvoptimizer/media


aydinyilmazeclawPRO

10 months ago

is it right way


10 months ago

mount the volume to /app/media


aydinyilmazeclawPRO

10 months ago

1266464829644734500


aydinyilmazeclawPRO

10 months ago

I created a volume and /app/media


10 months ago

show me your urls.py file please


aydinyilmazeclawPRO

10 months ago


10 months ago

please implement the static file server as shown here -


aydinyilmazeclawPRO

10 months ago

ok I changed and deployed, waiting for the procedure


aydinyilmazeclawPRO

10 months ago

ok deployment is succesfull, what should I do now


10 months ago

upload images


10 months ago

have you deloyed these changes?


aydinyilmazeclawPRO

10 months ago

no I am also deploying them


aydinyilmazeclawPRO

10 months ago

last status

1266470208894140400


aydinyilmazeclawPRO

10 months ago

ok thank you


aydinyilmazeclawPRO

10 months ago

1266470568786530300


aydinyilmazeclawPRO

10 months ago

happy end 🙂


10 months ago

awsome