from flask import Flask from flask_cors import CORS from config import Config from app.utils import markdown_to_html from app.extensions import db def create_app(): app = Flask(__name__) app.config.from_object(Config) # Initialize extensions CORS(app) db.init_app(app) # Register Markdown filter app.jinja_env.filters['markdown'] = markdown_to_html # Register blueprints from app.routes import main, admin, api app.register_blueprint(main) app.register_blueprint(admin, url_prefix='/admin') app.register_blueprint(api, url_prefix='/api') # Create database tables with app.app_context(): db.create_all() return app