百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#799·django-debug-toolbar

缓存面板不处理模块级上导入的"缓存"

作者: blueyed创建于 2016年1月11日更新于 2026年8月8日
标签Bug

在模块中使用 `from django.core.cache import caches` 时,该模块只在处理视图之前加载,此时 `caches.caches` 实例不会通过 `CacheHandlerPatch` 进行修改。一种可能的解决方案是不要在此使用 `enable_instrumentation` / `disable_instrumentation`,而是在导入时在 `debug_toolbar.panels.cache` 中执行此操作。

内容来源: django-commons/django-debug-toolbar

查看 GitHub 原文在 GitHub 查看讨论