Skip to content

Commit

Permalink
backend: database url 환경변수화
Browse files Browse the repository at this point in the history
  • Loading branch information
kimtaejin3 committed Dec 12, 2024
1 parent 4bc85f3 commit e0ace51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions backend/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
DB_PASSWORD=sLEQDIgpabTTlLEy
//server url
//
Binary file modified backend/__pycache__/database.cpython-313.pyc
Binary file not shown.
8 changes: 7 additions & 1 deletion backend/database.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import os
from dotenv import load_dotenv
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
from datetime import datetime
from sqlalchemy.dialects.postgresql import ARRAY

DATABASE_URL = "postgresql://postgres.gmpgjtjmalohyjsespkr:[email protected]:6543/postgres"
load_dotenv()

DB_PASSWORD = os.getenv("DB_PASSWORD")

DATABASE_URL = f"postgresql://postgres.gmpgjtjmalohyjsespkr:{DB_PASSWORD}@aws-0-ap-northeast-2.pooler.supabase.com:6543/postgres"

engine = create_engine(
DATABASE_URL,
Expand Down

0 comments on commit e0ace51

Please sign in to comment.