zhaoqingang
2024-12-17 8374ae83b837dcd2e88cccbe42db20fd5bf2ce30
app/models/base_model.py
@@ -1,10 +1,12 @@
import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, Session
from app.config.config import settings
DATABASE_URL = settings.database_url
DATABASE_URL = os.getenv('DATABASE_URL') or settings.database_url
engine = create_engine(DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)