django-sendfile2
django-sendfile2 copied to clipboard
Allow bypassing of mimetype and encoding guessing
Following on from #18
sendfile()
currently checks if the requested file exists regardless of chosen backend. However, most backends actually support serving files that are not necessarily accessibly to the Django app.
- File exists checks should only happen when data for headers is not available (implying the user wants us to do it for them)
- Add a kwarg for content length
- Simple and development backends assume that the file exists if they are called, either make those backends aware or wrap the backend call in an appropriate try/except