The thing about locmem is that it really is just a local memory storage. Looking at the code, it's clear that the data is just being saved in a module-level variable, _caches
, in that module. So you can just do
from django.core.cache.backends import locmem
print(locmem._caches)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…