sort and fix backend imports
This commit is contained in:
1 parent
08efabc696
commit
c386d0b1a5
63 files changed
+598
-1023
No files matched your search
+16
-44
@@ -1,58 +1,30 @@
|
||||
from sqlalchemy import create_engine, Column, Integer, DateTime, JSON, func
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import logging
|
||||
import importlib.metadata
|
||||
import pkgutil
|
||||
from urllib.parse import urlparse
|
||||
import os
|
||||
import shutil
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Generic, Optional, TypeVar
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import chromadb
|
||||
from chromadb import Settings
|
||||
from typing import TypeVar, Generic
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
from pathlib import Path
|
||||
import json
|
||||
import yaml
|
||||
|
||||
import requests
|
||||
import shutil
|
||||
|
||||
|
||||
import yaml
|
||||
from apps.webui.internal.db import Base, get_db
|
||||
|
||||
from constants import ERROR_MESSAGES
|
||||
|
||||
from chromadb import Settings
|
||||
from env import (
|
||||
ENV,
|
||||
VERSION,
|
||||
SAFE_MODE,
|
||||
GLOBAL_LOG_LEVEL,
|
||||
SRC_LOG_LEVELS,
|
||||
BASE_DIR,
|
||||
DATA_DIR,
|
||||
BACKEND_DIR,
|
||||
FRONTEND_BUILD_DIR,
|
||||
WEBUI_NAME,
|
||||
WEBUI_URL,
|
||||
WEBUI_FAVICON_URL,
|
||||
WEBUI_BUILD_HASH,
|
||||
CONFIG_DATA,
|
||||
DATABASE_URL,
|
||||
CHANGELOG,
|
||||
DATA_DIR,
|
||||
ENV,
|
||||
FRONTEND_BUILD_DIR,
|
||||
WEBUI_AUTH,
|
||||
WEBUI_AUTH_TRUSTED_EMAIL_HEADER,
|
||||
WEBUI_AUTH_TRUSTED_NAME_HEADER,
|
||||
WEBUI_SECRET_KEY,
|
||||
WEBUI_SESSION_COOKIE_SAME_SITE,
|
||||
WEBUI_SESSION_COOKIE_SECURE,
|
||||
WEBUI_FAVICON_URL,
|
||||
WEBUI_NAME,
|
||||
log,
|
||||
)
|
||||
from pydantic import BaseModel
|
||||
from sqlalchemy import JSON, Column, DateTime, Integer, func
|
||||
|
||||
|
||||
class EndpointFilter(logging.Filter):
|
||||
@@ -72,8 +44,8 @@ logging.getLogger("uvicorn.access").addFilter(EndpointFilter())
|
||||
def run_migrations():
|
||||
print("Running migrations")
|
||||
try:
|
||||
from alembic.config import Config
|
||||
from alembic import command
|
||||
from alembic.config import Config
|
||||
|
||||
alembic_cfg = Config(BACKEND_DIR / "alembic.ini")
|
||||
command.upgrade(alembic_cfg, "head")
|
||||
|
||||
Reference in new issue
Block a user