R
Railwayā€¢4mo ago
aydin26532

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:
please implement the static file server as shown here - https://github.com/vfehring/django-volumes/blob/master/mysite%2Furls.py...
Jump to solution
38 Replies
Percy
Percyā€¢4mo ago
Project ID: 118c0d3a-2e06-4eee-b22c-ab02d2947048
aydin26532
aydin26532OPā€¢4mo ago
118c0d3a-2e06-4eee-b22c-ab02d2947048
Brody
Brodyā€¢4mo ago
im sorry but "I can not see the picture" is not super helpful, please provide actual errors
aydin26532
aydin26532OPā€¢4mo ago
I am uploading a profile photo but it doesnt work
No description
No description
aydin26532
aydin26532OPā€¢4mo ago
this is related database
No description
aydin26532
aydin26532OPā€¢4mo ago
postgres database
Brody
Brodyā€¢4mo ago
what errors are you getting though? 404?
aydin26532
aydin26532OPā€¢4mo ago
actually I dont take any error, but profile photos of users can not be seen is it about github or railway
Brody
Brodyā€¢4mo ago
there are errors somewhere, please provide them check your dev tools for your browser
aydin26532
aydin26532OPā€¢4mo ago
ok let me look btw. I didn't create a MongoDB I only have postgres is it enough
Brody
Brodyā€¢4mo ago
what does mongo have to do with this lol
aydin26532
aydin26532OPā€¢4mo ago
Can I use github also for profile pictures šŸ™‚
Brody
Brodyā€¢4mo ago
please provide errors
aydin26532
aydin26532OPā€¢4mo ago
Ok, I though Mongo is for files and images
aydin26532
aydin26532OPā€¢4mo ago
No description
aydin26532
aydin26532OPā€¢4mo ago
this is the errros from console yes it seems that it is 404
Brody
Brodyā€¢4mo ago
what is your volume's mount point
aydin26532
aydin26532OPā€¢4mo ago
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)
Brody
Brodyā€¢4mo ago
that is useful information, but that doesn't actually answer my question do you not have a volume?
aydin26532
aydin26532OPā€¢4mo ago
No description
aydin26532
aydin26532OPā€¢4mo ago
as I understand you are asking this I don't have this in my project I have two files, postgres and proejct
Brody
Brodyā€¢4mo ago
go ahead and mount a volume to /app/media those are services, not files
aydin26532
aydin26532OPā€¢4mo ago
No description
aydin26532
aydin26532OPā€¢4mo ago
sorry services my app name yvoptimizer/media is it right way
Brody
Brodyā€¢4mo ago
mount the volume to /app/media
aydin26532
aydin26532OPā€¢4mo ago
No description
aydin26532
aydin26532OPā€¢4mo ago
I created a volume and /app/media
Brody
Brodyā€¢4mo ago
show me your urls.py file please
aydin26532
aydin26532OPā€¢4mo ago
Solution
Brody
Brodyā€¢4mo ago
please implement the static file server as shown here - https://github.com/vfehring/django-volumes/blob/master/mysite%2Furls.py
aydin26532
aydin26532OPā€¢4mo ago
ok I changed and deployed, waiting for the procedure ok deployment is succesfull, what should I do now
Brody
Brodyā€¢4mo ago
upload images have you deloyed these changes?
aydin26532
aydin26532OPā€¢4mo ago
no I am also deploying them
aydin26532
aydin26532OPā€¢4mo ago
last status
No description
aydin26532
aydin26532OPā€¢4mo ago
ok thank you
aydin26532
aydin26532OPā€¢4mo ago
No description
aydin26532
aydin26532OPā€¢4mo ago
happy end šŸ™‚
Brody
Brodyā€¢4mo ago
awsome
Want results from more Discord servers?
Add your server