sudacode b7e89d9c22
All checks were successful
Build Docker Image / build (push) Successful in 12m39s
V0.2.0
2025-02-13 17:46:15 -08:00

25 lines
574 B
Python

from flask import Flask
from app.config import Config
from app.database import engine
from app.models import Base
from app.views import bp
from app.migrations import run_migrations
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_object(Config)
# Create database tables if they don't exist
Base.metadata.create_all(engine)
# Register blueprints
app.register_blueprint(bp)
# Run migrations after tables are created
with app.app_context():
run_migrations(app)
return app