web后端
ikebo
ikebo.cc
展开
-
Flask 按路径返回图片
1,读取图片数据(二进制读取) 2,返回数据,并将mimetype设为图片格式对应的mimetype 示例代码 def get_image(uri): imgPath = '../../static/uploads' + uri mdict = { 'jpeg': 'image/jpeg', 'jpg': 'image/jpeg', ...原创 2018-08-05 22:44:48 · 11335 阅读 · 0 评论 -
sqlalchemy 中 desc 的使用
是这样: items = Item.query.order_by(Item.date.desc()).all() 而不是这样: items = Item.query.order_by(desc(Item.date)).all() 更不是说了一大堆SQLALCHEMY的查询方式别人看半天也没找到自己需要的。...原创 2018-08-02 22:59:57 · 5607 阅读 · 1 评论 -
LAF后端性能测试(ab)
##LAF后端性能测试 ###1)首页第一页加载: 并发量50 Document Path: /service/api/v1/item?page=0 Document Length: 2965 bytes Concurrency Level: 50 Complete requests: 1000 Failed requests: 2 Requests p...原创 2018-09-30 09:03:47 · 660 阅读 · 0 评论