How to deploy image for django application
aydinyilmazeclaw
PROOP

2 years 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??

54 Replies

aydinyilmazeclaw
PROOP

2 years ago

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


2 years ago

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


aydinyilmazeclaw
PROOP

2 years ago

I am uploading a profile photo but it doesnt work

1266457528305193000
1266457537427804200


aydinyilmazeclaw
PROOP

2 years ago

this is related database

1266457915196313600


aydinyilmazeclaw
PROOP

2 years ago

postgres database


2 years ago

what errors are you getting though? 404?


aydinyilmazeclaw
PROOP

2 years ago

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


aydinyilmazeclaw
PROOP

2 years ago

is it about github


aydinyilmazeclaw
PROOP

2 years ago

or railway


2 years ago

there are errors somewhere, please provide them


2 years ago

check your dev tools for your browser


aydinyilmazeclaw
PROOP

2 years ago

ok let me look


aydinyilmazeclaw
PROOP

2 years ago

btw. I didn't create a MongoDB


aydinyilmazeclaw
PROOP

2 years ago

I only have postgres


aydinyilmazeclaw
PROOP

2 years ago

is it enough


2 years ago

what does mongo have to do with this lol


aydinyilmazeclaw
PROOP

2 years ago

Can I use github also for profile pictures


aydinyilmazeclaw
PROOP

2 years ago

🙂


2 years ago

please provide errors


aydinyilmazeclaw
PROOP

2 years ago

Ok, I though Mongo is for files and images


aydinyilmazeclaw
PROOP

2 years ago

1266459947386798000


aydinyilmazeclaw
PROOP

2 years ago

this is the errros from console


aydinyilmazeclaw
PROOP

2 years ago

yes it seems that it is 404


2 years ago

what is your volume's mount point


aydinyilmazeclaw
PROOP

2 years ago

I am looking now


aydinyilmazeclaw
PROOP

2 years 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)


2 years ago

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


2 years ago

do you not have a volume?


aydinyilmazeclaw
PROOP

2 years ago

1266462902060318700


aydinyilmazeclaw
PROOP

2 years ago

as I understand you are asking this


aydinyilmazeclaw
PROOP

2 years ago

I don't have this in my project


aydinyilmazeclaw
PROOP

2 years ago

I have two files, postgres and proejct


2 years ago

go ahead and mount a volume to /app/media


2 years ago

those are services, not files


aydinyilmazeclaw
PROOP

2 years ago

1266463289374802200


aydinyilmazeclaw
PROOP

2 years ago

sorry services


aydinyilmazeclaw
PROOP

2 years ago

my app name yvoptimizer/media


aydinyilmazeclaw
PROOP

2 years ago

is it right way


2 years ago

mount the volume to /app/media


aydinyilmazeclaw
PROOP

2 years ago

1266464829644734500


aydinyilmazeclaw
PROOP

2 years ago

I created a volume and /app/media


2 years ago

show me your urls.py file please


aydinyilmazeclaw
PROOP

2 years ago


2 years ago

please implement the static file server as shown here -


aydinyilmazeclaw
PROOP

2 years ago

ok I changed and deployed, waiting for the procedure


aydinyilmazeclaw
PROOP

2 years ago

ok deployment is succesfull, what should I do now


2 years ago

upload images


2 years ago

have you deloyed these changes?


aydinyilmazeclaw
PROOP

2 years ago

no I am also deploying them


aydinyilmazeclaw
PROOP

2 years ago

last status

1266470208894140400


aydinyilmazeclaw
PROOP

2 years ago

ok thank you


aydinyilmazeclaw
PROOP

2 years ago

1266470568786530300


aydinyilmazeclaw
PROOP

2 years ago

happy end 🙂


2 years ago

awsome


Loading...