Django as S3 proxy

Posted by schneck on Stack Overflow See other posts from Stack Overflow or by schneck
Published on 2010-04-14T11:08:14Z Indexed on 2010/04/14 11:13 UTC
Read the original article Hit count: 364

Filed under:
|
|
|
|

Hi there,

I extended a ModelAdmin with a custom field "Download file", which is a link to a URL in my Django project, like:

http://www.myproject.com/downloads/1

There, I want to serve a file which is stored in a S3-bucket. The files in the bucket are not public readable, and the user may not have direct access to it. Now I want to

  • avoid that the file has to be loaded in the server memory (these are multi-gb-files)
  • avoid to have temp files on the server

The ideal solution would be to let django act as a proxy that streams S3-chunks directly to the user. I use boto, but did not find a possibility to stream the chunks. Any ideas?

Thanks.

© Stack Overflow or respective owner

Related posts about django

Related posts about boto