Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.680s · 67.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.2s · import 0.596s · 68MB
66MB installed
● package 66MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RangedFileResponse
✓ from ranged_response import RangedFileResponse
✗ from django_ranged_response import RangedFileResponse
Package name uses underscore, not hyphen.
RangedResponse
✓ from ranged_response import RangedResponse
Alias for RangedFileResponse.
Basic usage in a Django view returning a file with range support.
from django.http import FileResponse
from ranged_response import RangedFileResponse
class MyView:
def get(self, request):
file_path = '/path/to/file.txt'
response = RangedFileResponse(request, open(file_path, 'rb'))
return response
Errors
Common errors & fixes
AttributeError: 'RangedFileResponse' object has no attribute 'seek'
The file-like object passed must support seek operations.
fixOpen the file in binary read mode with 'rb' and ensure it is a real file object, not a BytesIO without seek.
ImportError: No module named 'ranged_response'
Attempting to import with hyphens or wrong package name.
fixInstall via 'pip install django-ranged-response' and import as 'from ranged_response import RangedFileResponse'.
Upgrade
Version history
0.2.0latest on PyPI · released Jul 18, 2017
Audit
Dependencies
DjangorequiredRequires Django's FileResponse as base class.