code: def safe_get_user_model():
      
      user_app, user_model = settings.AUTH_USER_MODEL.split('.')
      return apps.get_registered_model(user_app, user_model)
docs: Safe loading of the User model, customized or not.