Registry / web-framework / django-ranged-response

django-ranged-response

JSON →
library0.2.0pypypi✓ verified 87d ago

A modified Django FileResponse that adds Content-Range headers for partial content support in file downloads. Version 0.2.0 is the latest, with no recent updates.

pip install django-ranged-response
INSTALL
IMPORT
SIG · DJANGO-RANGED-RESP
D
django-ranged-response
web-frameworkpythonv0.2.0
Install
4.2s avg
Import
638ms
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.680s · 67.7MB
glibc
py 3.103.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
Debug
Known issues
gotchaThe library is named 'django-ranged-response' on PyPI, but import uses 'ranged_response' (underscore, not hyphen).
fix
Use 'from ranged_response import RangedFileResponse'.
affects: all
deprecatedThe library has not been updated since 2019 and may not support newer Django versions (e.g., Django 4.x+).
fix
Consider using Django's built-in FileResponse with custom range headers or other maintained libraries.
affects: >=0.2.0
gotchaRequires passing the HttpRequest object as the first argument to RangedFileResponse. Forgetting this causes incorrect range handling.
fix
Always pass 'request' as first argument: RangedFileResponse(request, file_handle).
affects: all
Errors
Common errors & fixes
AttributeError: 'RangedFileResponse' object has no attribute 'seek'
The file-like object passed must support seek operations.
fix
Open 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.
fix
Install 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.
Agent activity
8 hits · last 30 days
node
8
Resources
django-ranged-response — pip install django-ranged-response · libregistry