1、查看innodb死锁情况查看事务情况show engine innodb status\G查看事务详情SELECT * FROM information_schema.INNODB_TRX\G2、kibana 4 添加图表,以及如何在dashboard【仪表板】上展示所有的图表或者分开展示图表添加图表的流程一定要清楚,先要有visualization【可视化视图】,然后才能在dashboard【仪表板】上面添加图表,事实上图表就是所谓的visualization【可视化视图】;这里的操作关键比较难的是如何添加visualization【可视化视图】,并且在添加visualization【可视化视图】过程中的Filter的操作。Filter说起来也很简单就是搜索出你要展示的数据数量的值,比如访问链接地址的时长,某个链接的请求次数的值。关键是在添加visualization【可视化视图】过程中,先要选择视图的类型,然后就要对metrics和buckets的操作。这里有一篇关于kibana4的图表入门:请点击这里3、curl 指定用户以及密码访问很简单:curl -u user:password -XGET http://www.xxx.net/study/就可以了.4、通过python的线程实现异步发送邮件from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
msg = Message(app.config['FLASKY_MAIL_SUBJECT_PREFIX'] + subject,
sender=app.config['FLASKY_MAIL_SENDER'], recipients=[to])
msg.body = render_template(template + '.txt', **kwargs)
msg.html = render_template(template + '.html', **kwargs)
thr = Thread(target=send_async_email, args=[app, msg])
thr.start()
return thr5、针对Flask项目初始化数据库 >>> from walkerfree import config
>>> from walkerfree import app
>>> app.config.from_object(config['development'])
>>> from walkerfree import db
>>> db.init_app(app)
>>> db
>>> db.create_all()