04 2025 档案

摘要:# 禁用外键约束 SET FOREIGN_KEY_CHECKS = 0; -- 执行你的迁移脚本 # 启用外键约束 SET FOREIGN_KEY_CHECKS = 1; 阅读全文
posted @ 2025-04-23 10:40 wellplayed 阅读(24) 评论(0) 推荐(0)
摘要:1、首先下载模块 pip install pyinstaller 2、选择一个需要打包成exe的文件 # 以这个文件为例 random.py 3、然后在文件所在目录运行 pyinstaller --onefile random.py 4、可以发现当前目录的dist文件夹下有一个exe文件 5、双击. 阅读全文
posted @ 2025-04-15 10:36 wellplayed 阅读(33) 评论(0) 推荐(0)
摘要:1. match_all - 查询所有文档 query = { "query": { "match_all": {} } } res = es.search(index="books", body=query) for hit in res["hits"]["hits"]: print(hit["_ 阅读全文
posted @ 2025-04-10 10:29 wellplayed 阅读(69) 评论(0) 推荐(0)
摘要:在Django项目中配置全局日志组件 settings文件配置 from datetime import date # 日志配置 LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose 阅读全文
posted @ 2025-04-10 10:16 wellplayed 阅读(112) 评论(0) 推荐(0)
摘要:安装依赖 pip install elasticsearch 安装完成后我们即可使用 from elasticsearch import Elasticsearch 进行连接与操作。 连接 ElasticSearch from elasticsearch import Elasticsearch 创 阅读全文
posted @ 2025-04-09 17:37 wellplayed 阅读(142) 评论(0) 推荐(0)