added .env dataclass
This commit is contained in:
0
backend/src/configuration/__init__.py
Normal file
0
backend/src/configuration/__init__.py
Normal file
18
backend/src/configuration/environment.py
Normal file
18
backend/src/configuration/environment.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""This module is for loading variables from the environment and passes them throughout the code using the Environment dataclass"""
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
# Load variables from environment
|
||||
load_dotenv(override=True)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Environment :
|
||||
|
||||
supabase_url = os.environ['SUPABASE_URL']
|
||||
supabase_admin_key = os.environ['SUPABASE_ADMIN_KEY']
|
||||
supabase_test_user_id = os.environ['SUPABASE_TEST_USER_ID']
|
||||
Reference in New Issue
Block a user