Skip to main content

user_model_swapped

Clears the application cache and updates the UserModel reference across various Django auth modules when the AUTH_USER_MODEL setting is changed.

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

Updates internal Django auth references when the AUTH_USER_MODEL setting is changed, ensuring that backends, forms, and management commands use the newly defined user model.

Parameters

NameTypeDescription
settingstringThe name of the Django setting that was modified.
**kwargsdictAdditional keyword arguments passed by the setting_changed signal dispatcher.

Returns

TypeDescription
nullNothing is returned; this function performs side effects by updating module-level variables and clearing the app cache.