sync: migrate secure-online-shop to Gitea (2026-08-10)

This commit is contained in:
konturai-ops
2026-08-10 15:26:59 +00:00
commit 2022c8890d
44 changed files with 3196 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
from __future__ import annotations
import logging
from app.core.config import get_settings
from app.db.seed_demo import seed_demo_products
from app.db.session import engine
from app.models import Base
logger = logging.getLogger("app.db")
def initialize_database() -> None:
Base.metadata.create_all(bind=engine)
logger.info("Database tables created successfully")
settings = get_settings()
if settings.demo_seed_products:
from app.db.session import SessionLocal
with SessionLocal() as db:
seed_demo_products(db, settings.demo_product_count)
if __name__ == "__main__":
initialize_database()
print("Database initialized successfully.")
print("To create a shop account, run: python -m app.db.create_shop_account")