Skip to main content

Abstraction to offload file uploads to web-server (e.g. Apache with mod_xsendfile) once Django has checked permissions etc.

Project description Documentation Status

This is a wrapper around web-server specific methods for sending files to web clients. This is useful when Django needs to check permissions associated files, but does not want to serve the actual bytes of the file itself. i.e. as serving large files is not what Django is made for.

Note this should not be used for regular file serving (e.g. CSS etc), only for cases where you need Django to do some work before serving the actual file.

Supported Python Versions

Python 3.7, 3.8, 3.9, and 3.10 are currently supported by this library.

Supported Django Versions

Django 2.2, 3.2, and 4.0 are currently supported by this library.


This project is a fork of django-sendfile. The original project appears mostly dead and has a number of outstanding bugs (especially with Python 3).


If you have found django-sendfile2 to be useful and would like to see its continued development, please consider buying me a coffee.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-sendfile2, version 0.6.1
Filename, size File type Python version Upload date Hashes
Filename, size django_sendfile2-0.6.1-py3-none-any.whl (10.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-sendfile2-0.6.1.tar.gz (26.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page