fix(db): use settings for connection to support native env
This commit is contained in:
@@ -8,11 +8,12 @@ from config import get_settings
|
||||
|
||||
def get_db():
|
||||
# Einfache, robuste DB-Verbindung pro Aufruf
|
||||
settings = get_settings()
|
||||
conn = pymysql.connect(
|
||||
host=os.getenv("MARIADB_HOST", "db"),
|
||||
user=os.getenv("MARIADB_USER", "crumb"),
|
||||
password=os.getenv("MARIADB_PASSWORD", "secret"),
|
||||
database=os.getenv("MARIADB_DATABASE", "crumbcrm"),
|
||||
host=settings.mariadb_host,
|
||||
user=settings.mariadb_user,
|
||||
password=settings.mariadb_password,
|
||||
database=settings.mariadb_database,
|
||||
autocommit=True,
|
||||
charset="utf8mb4",
|
||||
cursorclass=DictCursor,
|
||||
|
||||
Reference in New Issue
Block a user