22 lines
464 B
Python
22 lines
464 B
Python
from flask import Flask
|
|
from app.config import Config
|
|
from app.extensions import db, mail
|
|
|
|
def create_app(config_class=Config):
|
|
app = Flask(__name__)
|
|
app.config.from_object(config_class)
|
|
|
|
# Initialize extensions
|
|
db.init_app(app)
|
|
mail.init_app(app)
|
|
|
|
# Register Blueprints
|
|
from app.routes import bp as main_bp
|
|
app.register_blueprint(main_bp)
|
|
|
|
# Create DB tables
|
|
with app.app_context():
|
|
db.create_all()
|
|
|
|
return app
|