[Answer]-Django download file


I personally would put this file into the media directory and let your server do the streaming of the file rather than django unless you really need it to.

serving static files in django is really inefficient so your always better off doing this through the web server which has been specifically optimized for serving data.

From the django docs https://docs.djangoproject.com/en/1.5/howto/static-files/#configuring-static-files

Serving the files

In addition to these configuration steps, you’ll also need to actually
serve the static files.

During development, this will be done automatically if you use
runserver and DEBUG is set to True (see

This method is grossly inefficient and probably insecure, so it is unsuitable for production.

See Deploying static files for proper strategies to serve static files in production environments.

Leave a comment