1

Using Django, I've deployed my web app to http://159.223.177.51/. To login to see the images, use sof///stackoverflow123

I can see the custom fonts and CSS so I know static is working. However, none of the media files are showing. When I try to upload a photo using the forms on the web app, it gives me a 505 error.

On localhost on my desktop computer, all the images work properly using manage.py runserver. When I uploaded it to ubuntu and edited the new location of the files, none of it works. I've looked through similar posts like this but it didn't solve it.

Here's what I tried in settings.py:

MEDIA_ROOT= os.path.join(BASE_DIR,'/home/stelity/myonlinefp/foodpantry/media') 
MEDIA_URL= "/media/"

DEBUG = FALSE

And in urls.py:

]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

I also edited the permissions of the media folder to allow everyone to read/write/execute and that didn't solve it either.

stelity
  • 33
  • 8

0 Answers0