from flask import Flask from flask_mail import Mail mail = Mail() def init_app(): app = Flask(__name__) app.config.from_object("config.Config") mail.init_app(app) with app.app_context(): from . import main return app