'Gets the access keys to use when accessing S3. If none
are provided to the class in the constructor or in the
settings then get them from the environment variables.'

def _get_access_keys(self):

    def lookup_env(names):
        for name in names:
            value = os.environ.get(name)
            if value:
                return value
    access_key = (self.access_key or lookup_env(self.access_key_names))
    secret_key = (self.secret_key or lookup_env(self.secret_key_names))
    return (access_key, secret_key)
