R
Railway11mo ago
~sky

Django deployment strategy for serving media

Hello! I'm currently dealing with an issue regarding how to serve media from a Django application. I know the general strategy is to have a web server like nginx in front, pulling the files under /media (or whichever path is configured), and reverse proxying everything else back to the WSGI server handling django Problem is, I can't seem to run both the WSGI server AND a web server on the same service, so I can't use the uploaded files on a new deployment with nginx. I tried using the WhiteNoise middleware, which fixed statics for the admin site, but ended up noticing it doesn't deal with media files. Has anyone figured out a strategy to deal with this? if possible I'd like to avoid adding an S3-like object storage (I know I can deploy something like MinIO) for the time being
5 Replies
Percy
Percy11mo ago
Project ID: 02edd57b-a5c8-43a8-9e48-93212c876e12
~sky
~skyOP11mo ago
02edd57b-a5c8-43a8-9e48-93212c876e12
~sky
~skyOP11mo ago
that's for statics, not media (user uploaded content) the statics part is handled already by using the whitenoise middleware
Brody
Brody11mo ago
check out this template https://github.com/vfehring/django-volumes specifically the urls.py file
Want results from more Discord servers?
Add your server