static-ranges
WSGI middleware for handling HTTP byte-ranges, i.e.
Request header: Range: bytes=0-1
Response header: Accept-Ranges: bytes or none
Response status: 206 Partial Content or 416 Requested range not satisfiable with Content-Range of *
Response header: Content-Range: bytes 0-1/2333748
Response header: Content-Length: 2
Implemented originally for use with waitress or gunicorn, django, dj-static and static3 because Safari requires byte-range support when requesting HTML5 videos.
Status and caveats
static-ranges has been developed as a quick way to get an app up and running on Heroku for testing with all static and media files served from the same place. Probably not production ready.
static-ranges only supports single ranges (or overlapping ranges that condense to a single range) but that probably covers 99.9% of usage.
Install
It is available from pypi like so:
$ pip install static-ranges
Usage
Wrap your application in wsgi.py with Ranges as the outermost layer, for example:
from static_ranges import Ranges
application = Ranges(Cling(MediaCling(application)))
Optionally you can disable support which will send the Accept-Ranges: none header using:
application = Ranges(Cling(MediaCling(application)), enable=False)
Metadata
Release files for static-ranges 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| static-ranges-0.2.0.tar.gz | 5.2 kB | Without provenance | Details for static-ranges-0.2.0.tar.gz |
Release files / static-ranges-0.2.0.tar.gz
| Download URL | static-ranges-0.2.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9eb86adfc27d1aefa6619cff7c8d5043937873c08eb86073cd822d4e32cae86
|
|
BLAKE2b-256 checksum How to use checksums |
1d45bbbdf8d5576da8f841ecdfac674159d259462d8449277a85c47808bd5b29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for static-ranges 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.