完成后端配置,用于部署
This commit is contained in:
16
backend/config.py
Normal file
16
backend/config.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
|
||||
class Settings:
|
||||
# 数据库配置
|
||||
DB_USER: str = "postgres"
|
||||
DB_PASS: str = "DXC_welcome001"
|
||||
DB_HOST: str = "8.155.144.6"
|
||||
DB_PORT: str = "25432"
|
||||
DB_NAME: str = "wiki_crawler"
|
||||
|
||||
@property
|
||||
def DATABASE_URL(self) -> str:
|
||||
url = f"postgresql+psycopg2://{self.DB_USER}:{self.DB_PASS}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
|
||||
return url
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user