~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
9 replies