Media Files fail to be served from disk to deployed django app

I have obtained 5GB of disk space with a mount point to my Django app here:
/opt/render/project/src/msp-dashboard/media

These are my media settings within my django application:
MEDIA_ROOT = "/opt/render/project/src/msp-dashboard/media" # configuration for render
MEDIA_URL = '/media/'

When I look at the event logs, I see this /media/ directory is a 404, yet when I access the storage location via shell, I see that the files exist. I am using django-tenants which serves the app to each tenant through postgres schema. App works completely fine on local. What am I overlooking?

404 Error in Logs:

I have read the disk docs, so please do not attach them.

Hey,

This seems more like a Django issue than a Render one. If you’ve already accessed your service, go to where the disk is mounted and check if the assets are there. If they are, it’s a config problem, not a Render issue. Make sure you’ve set it up to serve the files from that disk path instead of anywhere else. Since we don’t have access to your code, we’re not sure what’s going on or how you’ve set things up. Could you share more details from your settings.py and explain how you’ve configured the media to route to that path?

Are you sure your assets are in ‘~/project/src/msp-dashboard/media’ and not ‘~/project/src/msp-dashboard’?

Jérémy.
Render Support, UTC+3

1 Like