17 lines
639 B
Python
17 lines
639 B
Python
from os import environ
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
load_dotenv(".env")
|
|
|
|
SECRET_KEY = environ.get("SECRET_KEY")
|
|
DB_USER = environ.get("DB_USER")
|
|
DB_PASSWORD = environ.get("DB_PASSWORD")
|
|
DB_HOST = environ.get("DB_HOST")
|
|
DB_PORT = environ.get("DB_PORT")
|
|
DB_NAME = environ.get("DB_NAME")
|
|
DB_SOCKET_DIR = environ.get("DB_SOCKET_DIR", "/cloudsql")
|
|
CLOUD_SQL_CONNECTION_NAME = environ.get("CLOUD_SQL_CONNECTION_NAME")
|
|
# DB_URL = f"postgres+psycopg2://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}?host={DB_SOCKET_DIR}/{CLOUD_SQL_CONNECTION_NAME}"
|
|
DB_URL = f"postgres+psycopg2://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
|