2020
10-08
10-08
Python Flask异步发送邮件实现方法解析
第一步,修改工厂函数,配置邮件参数fromflaskimportFlaskfromconfigimportConfigfromflask_sqlalchemyimportSQLAlchemyfromflask_mailimportMaildb=SQLAlchemy()mail=Mail()defcreate_app():app=Flask(__name__)app.config.from_object(Config)db.init_app(app)mail.init_app(app)from.controllerimportcontrollerapp.register_blueprint(controller)returnapp第二步,新建一个线程来发送...
继续阅读 >