Compatibility functions for older Django cache backend configuration.
These functions are used to maintain compatibility or transition settings from older versions of Django.
- normalize_cache_backend(cache_backend, cache_name='default')¶
Return a new-style
CACHESdictionary from any given cache_backend.
Over time, Django has had support for two formats for a cache backend. The old-style
CACHE_BACKENDstring, and the new-style
This function will accept either as input and return a dictionary containing a single normalized entry for the given cache backend. This can be merged into the existing
CACHESdictionary is passed, the “default” cache will be the result.
A new-style cache backend dictionary containing the single cache backend referenced. If there were any parsing issues, an empty dictionary will be returned.