How to deploy image for django application
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??
Solution:Jump to solution
please implement the static file server as shown here -
https://github.com/vfehring/django-volumes/blob/master/mysite%2Furls.py...
38 Replies
Project ID:
118c0d3a-2e06-4eee-b22c-ab02d2947048
118c0d3a-2e06-4eee-b22c-ab02d2947048
im sorry but "I can not see the picture" is not super helpful, please provide actual errors
I am uploading a profile photo but it doesnt work
this is related database
postgres database
what errors are you getting though? 404?
actually I dont take any error, but profile photos of users can not be seen
is it about github
or railway
there are errors somewhere, please provide them
check your dev tools for your browser
ok let me look
btw. I didn't create a MongoDB
I only have postgres
is it enough
what does mongo have to do with this lol
Can I use github also for profile pictures
š
please provide errors
Ok, I though Mongo is for files and images
this is the errros from console
yes it seems that it is 404
what is your volume's mount point
I am looking now
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/' this is settings.py and related class class Customer(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_photo = models.ImageField(upload_to='profile_photos/', null=True, blank=True)
that is useful information, but that doesn't actually answer my question
do you not have a volume?
as I understand you are asking this
I don't have this in my project
I have two files, postgres and proejct
go ahead and mount a volume to
/app/media
those are services, not filessorry services
my app name yvoptimizer/media
is it right way
mount the volume to
/app/media
I created a volume and /app/media
show me your urls.py file please
Solution
please implement the static file server as shown here -
https://github.com/vfehring/django-volumes/blob/master/mysite%2Furls.py
ok I changed and deployed, waiting for the procedure
ok deployment is succesfull, what should I do now
upload images
have you deloyed these changes?
no I am also deploying them
last status
ok thank you
happy end š
awsome