Обновить main.py

This commit is contained in:
2025-11-10 19:31:33 +09:00
parent 6c812944ea
commit 371a008b09

View File

@@ -11,14 +11,10 @@ from sqlalchemy.ext.declarative import declarative_base
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
# Настройка подключения к БД # Настройка подключения к БД
DATABASE_URL = "mssql://mis_aokb_desktop_srv:HLqKhOMwPRjNAVvLIKtc@10.48.89.4:1433/amu_mis_AOKB_prod?" DATABASE_URL = "mssql://mis_aokb_desktop_srv:HLqKhOMwPRjNAVvLIKtc@10.48.89.4:1433/amu_mis_AOKB_prod?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes"
DRIVER_URL = "driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes"
# Создаем движок # Создаем движок
engine = create_engine( engine = create_engine(DATABASE_URL)
DATABASE_URL,
DRIVER_URL
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
# Базовый класс для моделей # Базовый класс для моделей