On May 19, 2008, at 4:18 AM, Julien wrote:

> I installed mod_xsendfile and I tried your code, but the file that's
> downloaded from the view is empty.
> This might be because I've tested it using the development server on
> port 8080. So I guess Apache is out of the loop :/

Yes, this approach only works for requests that go through Apache. I  
could have been clearer on how mod_xsendfile works, I guess. The  
request is handled just like any Django request. The response from  
Django is empty, as you saw; after authorization the view just sets  
the X-Sendfile header, which is what tells mod_xsendfile to take over  
the response handling and deliver the file. So without Apache and  
mod_xsendfile in the loop, you just get that empty response.

You could have Apache add a request header or some other indicator  
that the view could check, so it could handle the file itself in your  
development environment. Or you could just run under Apache instead of  
the dev server.

> I also have Apache running in parallel. Is there any way to have
> Apache send the file after the view (executed via dev server:8080)
> returns the response? Or is there any way around that issue?

No simple way springs to mind.

John


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

Reply via email to