04 2021 档案

摘要:安装 flask-cors pip install flask-cors 设置允许跨域 开启全局允许跨域 示例 from flask_cors import CORS CORS(app, supports_credentials=True) CORS 的参数 参数 类型 Head字段 说明 默认 r 阅读全文
posted @ 2021-04-28 14:04 JunCode 阅读(5645) 评论(0) 推荐(0)
摘要:将pandas 数据转换为 dict 这里将pandas 的dataframe 转化为 dict 使用的是 to_dict() 方法 这里放一部分源码: def to_dict(self, orient="dict", into=dict): Convert the DataFrame to a d 阅读全文
posted @ 2021-04-22 16:29 JunCode 阅读(1220) 评论(0) 推荐(0)
摘要:mongo shell 操作 aggregate 使用mongo db 的 aggregate 进行聚合操作,改操作传入的参数是一个数组 aggregate 操作的参数 match 相当于 mysql 的 where,传入的是筛选条件 示例: {$match : { 'os': 'win' } } 阅读全文
posted @ 2021-04-12 13:40 JunCode 阅读(183) 评论(0) 推荐(0)
摘要:获取GET请求参数 from Flask import request args = request.args 获取POST请求参数 获取 form 表单数据 from Flask import request args = request.form 将 form 表单的数据转为字典 args = 阅读全文
posted @ 2021-04-08 17:32 JunCode 阅读(301) 评论(0) 推荐(0)