Django's template doesn't render as expected (template language issue)

Without seeing the complete then-current versions of your custom manager, backend, and user model, it would be tough to explain. Browsing through the various classes show some tight interrelationships among them.

Just as one example, ModelBackend implements the following get_user method:

    def get_user(self, user_id):
        try:
            user = UserModel._default_manager.get(pk=user_id)
        except UserModel.DoesNotExist:
            return None
        return user if self.user_can_authenticate(user) else None

note how it’s not looking for objects as a specific manager, it’s looking for whatever the user model defines as the default manager.
(I’m not saying that this is in any way related to the issues you were facing. I’m only pointing out one example of the interrelationships existing between the backends and user model classes.)

So I think the only way to get the explanations you’re looking for would be to see the classes involved and follow the flow through the various components.

1 Like