Skip to content

Commit

Permalink
adjust db
Browse files Browse the repository at this point in the history
  • Loading branch information
djeck1432 committed Nov 29, 2024
1 parent 9f600e4 commit 28f48c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion apps/dashboard_app/data_conector.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(self):
f"{os.getenv('DB_USER')}:{os.getenv('DB_PASSWORD')}"
f"@{os.getenv('DB_HOST')}:{os.getenv('DB_PORT')}/{os.getenv('DB_NAME')}"
)
print(f"Database connection established: {self.db_url}")
self.engine = sqlalchemy.create_engine(self.db_url)

def fetch_data(self, query: str) -> pd.DataFrame:
Expand Down
8 changes: 4 additions & 4 deletions apps/data_handler/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

load_dotenv()

DB_USER = os.environ.get("DB_USER", "")
DB_PASSWORD = os.environ.get("DB_PASSWORD", "")
DB_SERVER = os.environ.get("DB_HOST", "")
DB_USER = os.environ.get("DB_USER", "postgres")
DB_PASSWORD = os.environ.get("DB_PASSWORD", "password")
DB_SERVER = os.environ.get("DB_HOST", "127.0.01")
DB_PORT = os.environ.get("DB_PORT", 5432)
DB_NAME = os.environ.get("DB_NAME", "")
DB_NAME = os.environ.get("DB_NAME", "data_handler")

SQLALCHEMY_DATABASE_URL = (f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_SERVER}:{DB_PORT}/{DB_NAME}")

Expand Down

0 comments on commit 28f48c6

Please sign in to comment.