Skip to content

Cache panel does not handle imported "caches" on module level #799

Open
@blueyed

Description

@blueyed

When using from django.core.cache import caches in a module, that is loaded only before a view is processed, this caches.caches instance will not be monkey-patched via CacheHandlerPatch.

One possible workaround would be to not use enable_instrumentation / disable_instrumentation for this, but do it in debug_toolbar.panels.cache on import time.

enable_instrumentation / disable_instrumentation could then be used still to enable/disable sending the signals, but caches would be wrapped always.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions