会员
周边
众包
新闻
博问
闪存
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Zeng
Think Twice, Code Once
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
5
···
23
下一页
[置顶]
ElasticSearch的查询关键字整合
摘要: 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
阅读(31)
评论(0)
推荐(0)
[置顶]
Splunk常用关键字
摘要: 1. search - 用于过滤事件 [search ... ] # 在默认情况下,所有搜索都隐含了 search 命令 2. index - 用于指定搜索的索引 index = "xxx" # 如果不指定索引,Splunk 会在所有可访问的索引中搜索 3. | - 管道符:将一个命令的输出作为另一
阅读全文
posted @ 2024-05-14 16:01 wellplayed
阅读(886)
评论(0)
推荐(0)
[置顶]
Django rest_framework——drf组件的使用
摘要: 基本组件的使用 -restful规范 -序列化组件 -APIView源码分析 -Response源码分析 -source用法 -定制字段的两种方式 -反序列化的保存与修改 -ModelSerializer用法 -请求与响应 -状态码 -GenericAPIView用法 -路由组件 -认证组件 -权限
阅读全文
posted @ 2023-11-20 21:03 wellplayed
阅读(29)
评论(1)
推荐(2)
[置顶]
一种编程思想——利用settings文件实现功能的增减
摘要: 一. 正常函数版本的思路 1. notify.py def wechat(content): print('微信通知:%s'%content) def qq(content): print('qq通知:%s'%content) def email(content): print('邮箱通知:%s'%
阅读全文
posted @ 2023-10-29 21:24 wellplayed
阅读(20)
评论(0)
推荐(2)
2025年8月22日
LLM(大型语言模型)核心概念解析
摘要: 在自然语言处理领域,LLM(Large Language Model) 已经成为热门技术,无论是文本生成、问答系统,还是代码生成和自动化运维,LLM 都展现了强大的能力。本文将梳理 LLM 的核心概念与应用场景,帮助快速理解和上手。 1. 什么是 LLM LLM,即大型语言模型,是基于深度学习训练的
阅读全文
posted @ 2025-08-22 13:32 wellplayed
阅读(43)
评论(0)
推荐(0)
2025年8月4日
为ES索引新增字段
摘要: 1、导入并生成ES对象 from elasticsearch import Elasticsearch es = Elasticsearch(['http://127.0.0.1:9200'], http_auth=('用户名', '密码')) 2、为指定索引添加字段 new_fields = {
阅读全文
posted @ 2025-08-04 09:45 wellplayed
阅读(114)
评论(0)
推荐(0)
2025年7月18日
Django Admin 后台自定义字段列显示
摘要: 原数据: class UserInfoAdmin(admin.ModelAdmin): """ 用户其他信息对应的admin管理后台 """ # 页面展示 list_display = ("display_name", "user", "telephone", "department") admin
阅读全文
posted @ 2025-07-18 14:59 wellplayed
阅读(20)
评论(0)
推荐(0)
2025年5月8日
Django Admin 下拉框添加搜索匹配功能(autocomplete)
摘要: 在 Django Admin 中,默认的下拉框会加载所有选项,对于数据量较大的外键字段来说,加载缓慢且不便于查找。我们可以通过 autocomplete_fields 实现输入搜索匹配的功能,提高后台管理效率。 一、原理说明 Django 从 2.0 起支持 autocomplete_fields,
阅读全文
posted @ 2025-05-08 14:38 wellplayed
阅读(64)
评论(0)
推荐(0)
2025年4月23日
迁移数据库时,禁用外键约束的方式
摘要: # 禁用外键约束 SET FOREIGN_KEY_CHECKS = 0; -- 执行你的迁移脚本 # 启用外键约束 SET FOREIGN_KEY_CHECKS = 1;
阅读全文
posted @ 2025-04-23 10:40 wellplayed
阅读(14)
评论(0)
推荐(0)
2025年4月15日
使用 pyinstaller模块 实现简单的py文件打包成exe的操作
摘要: 1、首先下载模块 pip install pyinstaller 2、选择一个需要打包成exe的文件 # 以这个文件为例 random.py 3、然后在文件所在目录运行 pyinstaller --onefile random.py 4、可以发现当前目录的dist文件夹下有一个exe文件 5、双击.
阅读全文
posted @ 2025-04-15 10:36 wellplayed
阅读(17)
评论(0)
推荐(0)
2025年4月10日
日志组件
摘要: 在Django项目中配置全局日志组件 settings文件配置 from datetime import date # 日志配置 LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose
阅读全文
posted @ 2025-04-10 10:16 wellplayed
阅读(26)
评论(0)
推荐(0)
2025年4月9日
使用Python操作ElasticSearch
摘要: 安装依赖 pip install elasticsearch 安装完成后我们即可使用 from elasticsearch import Elasticsearch 进行连接与操作。 连接 ElasticSearch from elasticsearch import Elasticsearch 创
阅读全文
posted @ 2025-04-09 17:37 wellplayed
阅读(85)
评论(0)
推荐(0)
2025年3月17日
Vue3将表格数据导出为XLSX格式
摘要: 首先导入xlsx库 import * as XLSX from 'xlsx'; 表格数据示例 // 后端获取表格数据 const filteredData = ref([]); // 数据列 const columns = [ { title: '用户名', dataIndex: 'username
阅读全文
posted @ 2025-03-17 17:30 wellplayed
阅读(81)
评论(0)
推荐(0)
1
2
3
4
5
···
23
下一页
公告