摘要:
devcontainer.json // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontain 阅读全文
posted @ 2025-08-22 21:46
hole_cheng
阅读(15)
评论(0)
推荐(0)
摘要:
POST -> 验证model类型 ->is_valid-> validate(当前) -> create -> validate(子序列化器)-> perform_create(serializer) 借用这种模式可以使用一主多辅的方式,通过一个viewset处理多张关联表的增删改查。 比如: c 阅读全文
posted @ 2025-08-22 21:17
hole_cheng
阅读(3)
评论(0)
推荐(0)
摘要:
from tenacity import retry # 配置重试:最多重试3次,每次间隔2秒,仅对请求异常重试 @retry( stop=stop_after_attempt(3), # 最多重试3次 wait=wait_fixed(2), # 每次重试间隔2秒 retry=retry_if_ex 阅读全文
posted @ 2025-08-22 20:50
hole_cheng
阅读(12)
评论(0)
推荐(0)
摘要:
import consul import json def get_config_from_consul(key): """从 Consul 获取配置并解析为字典""" # 连接 Consul 服务(默认地址 localhost:8500) c = consul.Consul() # 获取配置 in 阅读全文
posted @ 2025-08-22 20:32
hole_cheng
阅读(7)
评论(0)
推荐(0)
浙公网安备 33010602011771号