What's the best practice to serve media files from Django?

I have a Django service that allows users to upload files that are then converted in other format and stored for the users to download.

The file uploading works, I can see the files on the mounted disk instance, but I don’t see any option to serve them.

What’s the best practice for serving files from the persistent disk? I guess I can just use django.views.static.serve for that purpose, but it’s terribly inefficient, especially for large files and high user convurrency, because app server would be busy serving files instead of doing other valuable work.

What’s the best way to do it?

One alternative to storing the file on your persistent disk and having django manage writing/reading/serving the file to the user would be to store the user’s uploaded files in blob storage such as S3 instead.

This might be a helpful StackOverflow answer: https://stackoverflow.com/questions/12975228/download-files-from-amazon-s3-with-django .

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.