Skip to content

Question: JSON serialization may be incompatible with recording calls to the Django's cache(s) when using MemoryStore #2189

@GNajeraAdv

Description

@GNajeraAdv

Hi!

I'm trying to write up a concise example for version 6.0.0 of "django-debug-toolbar", but I think the JSON serialization introduced in release version 6.0.0 may be incompatible with recording calls to the Django's cache(s).

The only guideline for using the cache is "key should be a str, and value can be any picklable Python object.", and I'm actively seeing this erroring out in my project.

For example, when the "django-debug-toolbar" saves the "cache" panel details, it attempts to serialize the data into a JSON string.

However, it is perfectly valid for the data to contain complex Python objects (such as a Python dictionary that uses a Python Class as one of its keys).

I assume using "pickle" instead of JSON would resolve this, but maybe I'm oversimplifying this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions