On Sat, Mar 26, 2011 at 2:08 PM, Jacob Kaplan-Moss <ja...@jacobian.org> wrote:
> On Sat, Mar 26, 2011 at 6:31 AM, Graham Dumpleton
> <graham.dumple...@gmail.com> wrote:
>> In short, it is all a mess and trying to provide support for it in one bit
>> of code is possibly asking a bit much.
>
> One possible solution would be to split the problem up a bit. Django
> could provide an HttpFileResponse object. This would use the new lazy
> response mechanism in 1.3 to render the file locally (by doing a naive
> open/read) on demand. But then we could also ship a collection of
> middleware classes that know how to translate a HttpFileResponse for
> each various backend (FileResponseToXSendFile, FileResponseToXAccell,
> etc). Users could then select the correct piece of middleware for
> their upstream server or write their own for ones not supported out of
> the box.
>
> The nice thing about this approach is that it could be explored as a
> third-party app and made available to anyone using 1.3 or above.
>
> Can anyone see a reason why this wouldn't work? Want to throw some
> code together and give it a try?

That's pretty much exactly what django-filetransfers tries to do on
the download side:
http://www.allbuttonspressed.com/projects/django-filetransfers
Hotever it's not only for X-Sendfile, but also for any other file
serving mechanisms and it's not only for downloads, but also for
uploads. There's also a corresponding patch (which still needs lots of
work) for including that functionality in Django
(http://code.djangoproject.com/ticket/13960).

Is this what you were thinking of?

Bye,
Waldemar

-- 
Django on App Engine, MongoDB, ...? Browser-side Python? It's open-source:
http://www.allbuttonspressed.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to