edited environment and made it into a class

This commit is contained in:
MayDay9939 2023-10-27 15:42:05 +08:00
parent ea19abb95c
commit 3793721a7f
1 changed files with 5 additions and 2 deletions

View File

@ -1,10 +1,13 @@
import os
import boto3
from dotenv import load_dotenv
import environ
def initialize_s3_client():
# Load environment variables from .env file
load_dotenv()
env_path = os.path.join('safeshare', 'env')
# Load environment variables from the .env file
environ.Env.read_env(env_path)
# Access AWS credentials
aws_key = os.getenv('AWS_ACCESS_KEY_ID')