I am building a music player application with Django + nginx for which I need a backend which supports byte range requests.
Django is authenticating the media file correctly but django dev server does not support range requests (206 partial response). Nginx directly serves byte range requests after using this configuration<http://stackoverflow.com/questions/14598565/serving-206-byte-range-through-nginx-django>, I verified that the response header has content range. However I am unable to forward the request from django to nginx, to serve the content. I tried using X-Accel-Redirect<http://www.wellfireinteractive.com/blog/nginx-django-x-accel-redirects/> in a django view but still the response header doesn't have content range the way it would have been if the file had been directly served by nginx. - Django dev server - Authentication done but no byte range support (response 200) - Nginx - No authentication, byte range request support (response 206) - Django view + X-Accel-Redirect + nginx - Authentication done but no byte range support (response 200) So I am trying to find a way to authenticate using Django and provide support for byte range requests with nginx or another static file server. On Monday, April 14, 2014 9:00:37 AM UTC+5:30, md...@pdx.edu wrote: > > Is the Django community interested in supporting HTTP range requests in > django.views.static.serve<https://github.com/django/django/blob/master/django/views/static.py> > ? > > The primary benefit I see is that it makes files served up for <video> and > <audio> "seek-able" with the django server. This generally isn't a problem > for small files (except in > Chrome<http://stackoverflow.com/questions/8088364/html5-video-will-not-loop>), > > but becomes an issue for larger ones. > > Werkzeug has a function that parses the range > header<https://github.com/mitsuhiko/werkzeug/blob/5eed9385b861a1ae53c03eaae5a8dea4480113d6/werkzeug/http.py#L494>, > > which I used to support range requests in a Django application. I estimate > that robust support for HTTP range requests would cost <300 lines of code, > plus tests. > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/dc0e3e53-b065-4201-841d-59ce28255c72%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.