Ejemplo n.º 1
0
 def _get_access_keys(self):
     """
     Gets the access keys to use when accessing S3. If none is
     provided in the settings then get them from the environment
     variables.
     """
     access_key = self.access_key or lookup_env(S3BotoStorage.access_key_names)
     secret_key = self.secret_key or lookup_env(S3BotoStorage.secret_key_names)
     return access_key, secret_key
Ejemplo n.º 2
0
 def _get_access_keys(self):
     """
     Gets the access keys to use when accessing S3. If none is
     provided in the settings then get them from the environment
     variables.
     """
     access_key = self.access_key or lookup_env(S3BotoStorage.access_key_names)
     secret_key = self.secret_key or lookup_env(S3BotoStorage.secret_key_names)
     return access_key, secret_key
Ejemplo n.º 3
0
 def _get_security_token(self):
     """
     Gets the security token to use when accessing S3. Get it from
     the environment variables.
     """
     security_token = self.security_token or lookup_env(S3BotoStorage.security_token_names)
     return security_token
Ejemplo n.º 4
0
 def _get_security_token(self):
     """
     Gets the security token to use when accessing S3. Get it from
     the environment variables.
     """
     security_token = self.security_token or lookup_env(S3BotoStorage.security_token_names)
     return security_token
Ejemplo n.º 5
0
def get_endpoint_url():
    return setting("AWS_S3_ENDPOINT_URL") or lookup_env(
        ["AWS_S3_ENDPOINT_URL", "AWS_ENDPOINT_URL"])
Ejemplo n.º 6
0
def get_secret_access_key():
    return setting("AWS_S3_SECRET_ACCESS_KEY",
                   setting("AWS_SECRET_ACCESS_KEY")) or lookup_env(
                       ["AWS_S3_SECRET_ACCESS_KEY", "AWS_SECRET_ACCESS_KEY"])
Ejemplo n.º 7
0
def get_access_key_id():
    return setting("AWS_S3_ACCESS_KEY_ID",
                   setting("AWS_ACCESS_KEY_ID")) or lookup_env(
                       ["AWS_S3_ACCESS_KEY_ID", "AWS_ACCESS_KEY_ID"])
Ejemplo n.º 8
0
def get_bucket_name():
    return setting("AWS_STORAGE_BUCKET_NAME") or lookup_env(
        ["DJANGO_AWS_STORAGE_BUCKET_NAME"])