lab-2/app/__init__.py

23 lines
493 B
Python

from flask import Flask
from app.database import init_db
from app.orders.admin import admin_bp
from app.orders.shop import shop_bp
from app.orders.user import user_bp
def create_app() -> Flask:
app = Flask(
__name__,
template_folder="../templates",
static_folder="../static",
)
app.secret_key = "super-secret-key"
init_db()
app.register_blueprint(shop_bp)
app.register_blueprint(admin_bp)
app.register_blueprint(user_bp)
return app