- 更新了 User 类中的多个关系属性,修正了部分属性的拼写错误和关联关系 - 修改了 LazerUserProfileSections 类的关联关系 - 修正了 LazerUserBanners 类的结构和关联关系 - 更新了 create_sample_data.py 中的统计类引用 - 在 config.py 中更新了数据库连接 URL
26 lines
904 B
Python
26 lines
904 B
Python
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
class Settings:
|
|
# 数据库设置
|
|
DATABASE_URL: str = os.getenv("DATABASE_URL", "mysql+pymysql://root:Chinabug610@localhost:3306/osu_api")
|
|
REDIS_URL: str = os.getenv("REDIS_URL", "redis://localhost:6379/0")
|
|
|
|
# JWT 设置
|
|
SECRET_KEY: str = os.getenv("SECRET_KEY", "your-secret-key-here")
|
|
ALGORITHM: str = os.getenv("ALGORITHM", "HS256")
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", "1440"))
|
|
|
|
# OAuth 设置
|
|
OSU_CLIENT_ID: str = os.getenv("OSU_CLIENT_ID", "5")
|
|
OSU_CLIENT_SECRET: str = os.getenv("OSU_CLIENT_SECRET", "FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk")
|
|
|
|
# 服务器设置
|
|
HOST: str = os.getenv("HOST", "0.0.0.0")
|
|
PORT: int = int(os.getenv("PORT", "8000"))
|
|
DEBUG: bool = os.getenv("DEBUG", "True").lower() == "true"
|
|
|
|
settings = Settings()
|