Рефакторинг структуры проекта: шаблоны, статика и модули приложения

This commit is contained in:
2026-04-16 15:55:44 +00:00
parent d3fdc65116
commit 254a52fd47
15 changed files with 1998 additions and 1980 deletions

22
zkart_app/__init__.py Normal file
View File

@@ -0,0 +1,22 @@
from __future__ import annotations
from flask import Flask
from .config import BASE_DIR, SECRET_KEY
from .db import init_db
from .routes import bp
def create_app() -> Flask:
app = Flask(
__name__,
template_folder=str(BASE_DIR / "templates"),
static_folder=str(BASE_DIR / "static"),
)
app.secret_key = SECRET_KEY
app.register_blueprint(bp)
init_db()
return app
app = create_app()