def main():
    access_key = '<AWS_ACCESS_KEY>'
secret_key = '<AWS_SECRET_KEY>'
bucket = 'custom.domain.com'
key_prefix = 'css'
key_prefix = key_prefix + '/'
conn = S3Connection(access_key, secret_key, calling_format=VHostCallingFormat()
    )
bucket = conn.get_bucket(bucket)
keys = bucket.get_all_keys(prefix=key_prefix)
for k in keys:
    pass
Python Boto S3 to work with Custom Domains in Amazon S3