项目使用到了flask中的模块Flask_mail时报了错 KeyError: ‘mail’
调试源码如下:
# -*- coding: utf8 -*-
from flask import Flask
from flask_mail import Mail, Message
app = Flask(__name__)
app.config.update(
MAIL_SERVER='smtp.exmail.qq.com',
MAIL_PORT=465,
MAIL_USE_SSL=True,
MAIL_USERNAME='****@****.cn',
MAIL_PASSWORD='pwd' )
mail = Mail(app)
@app.route("/")
def index