mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-07 11:31:31 +01:00
Refactored db info to the .env file
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
import os
|
||||
from peewee import *
|
||||
from datetime import datetime
|
||||
from uuid import uuid4
|
||||
|
||||
from const import db
|
||||
DB_NAME = os.getenv("DB_NAME")
|
||||
DB_HOST = os.getenv("DB_HOST")
|
||||
DB_PORT = os.getenv("DB_PORT")
|
||||
DB_USER = os.getenv("DB_USER")
|
||||
DB_PASSWORD = os.getenv("DB_PASSWORD")
|
||||
|
||||
|
||||
# Establish connection to the database
|
||||
database = PostgresqlDatabase(
|
||||
db.DB_NAME,
|
||||
user=db.DB_USER,
|
||||
password=db.DB_PASSWORD,
|
||||
host=db.DB_HOST,
|
||||
port=db.DB_PORT
|
||||
DB_NAME,
|
||||
user=DB_USER,
|
||||
password=DB_PASSWORD,
|
||||
host=DB_HOST,
|
||||
port=DB_PORT
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user