{"id":21158,"library":"django-ranged-response","title":"django-ranged-response","description":"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.","status":"active","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/wearespindle/django-ranged-fileresponse","tags":["django","file-response","range-requests","partial-content"],"install":[{"cmd":"pip install django-ranged-response","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Requires Django's FileResponse as base class.","package":"Django","optional":false}],"imports":[{"note":"Package name uses underscore, not hyphen.","wrong":"from django_ranged_response import RangedFileResponse","symbol":"RangedFileResponse","correct":"from ranged_response import RangedFileResponse"},{"note":"Alias for RangedFileResponse.","wrong":null,"symbol":"RangedResponse","correct":"from ranged_response import RangedResponse"}],"quickstart":{"code":"from django.http import FileResponse\nfrom ranged_response import RangedFileResponse\n\nclass MyView:\n    def get(self, request):\n        file_path = '/path/to/file.txt'\n        response = RangedFileResponse(request, open(file_path, 'rb'))\n        return response","lang":"python","description":"Basic usage in a Django view returning a file with range support."},"warnings":[{"fix":"Use 'from ranged_response import RangedFileResponse'.","message":"The library is named 'django-ranged-response' on PyPI, but import uses 'ranged_response' (underscore, not hyphen).","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using Django's built-in FileResponse with custom range headers or other maintained libraries.","message":"The library has not been updated since 2019 and may not support newer Django versions (e.g., Django 4.x+).","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Always pass 'request' as first argument: RangedFileResponse(request, file_handle).","message":"Requires passing the HttpRequest object as the first argument to RangedFileResponse. Forgetting this causes incorrect range handling.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Open the file in binary read mode with 'rb' and ensure it is a real file object, not a BytesIO without seek.","cause":"The file-like object passed must support seek operations.","error":"AttributeError: 'RangedFileResponse' object has no attribute 'seek'"},{"fix":"Install via 'pip install django-ranged-response' and import as 'from ranged_response import RangedFileResponse'.","cause":"Attempting to import with hyphens or wrong package name.","error":"ImportError: No module named 'ranged_response'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}