Securing Uploaded Files

There are a couple different options - see django-protected-media · PyPI for an add-on that provides this facility. Also see the nginx docs at X-Accel | NGINX.

There’s also django-downloadview · PyPI

Note: We don’t use either of these. I have no direct experience with them and cannot speak to their quality / suitability of use.

While we have the need to do this as well, our usage of these types of files is so small that we serve them through Django directly. They’re an exception to our general pattern of serving static files through nginx.