Skip to main content

clear_routers_cache

Clears and reinitializes the cached database routers when the DATABASE_ROUTERS setting is modified.

def clear_routers_cache(
setting: string,
kwargs: dict
) - > null

Clears and reinitializes the cached list of database routers whenever the DATABASE_ROUTERS setting is modified.

Parameters

NameTypeDescription
settingstringThe name of the Django setting that was changed, used to trigger the cache refresh only when DATABASE_ROUTERS is updated.
kwargsdictAdditional keyword arguments passed by the setting_changed signal receiver.

Returns

TypeDescription
nullNothing is returned; the function modifies the global router state in-place.