[Django]-Django retrieval of list of files in S3 bucket

6👍

This should work.

from boto.s3.connection import S3Connection

conn = S3Connection(settings.AWS_ACCESS_KEY_ID,settings.AWS_SECRET_ACCESS_KEY)
bucket = conn.get_bucket(settings.MEDIA_BUCKET)

for key in bucket.list():
    print key.name

Leave a comment