Skip to content Skip to sidebar Skip to footer

Typeerror: Get_session_auth_hash() Missing 1 Required Positional Argument: 'self'

I am learning Django trying to implement a custom user model but every time i try to log into /admin with it i get two long lists of tracebacks which end in TypeError: get_session_

Solution 1:

In AuthenticationBackend.get_user, you have this:

if user.is_active:
            return User

which actually returns the Userclass instead of your user instance. The code calling on this method later tries to call get_session_auth_hash() on what you returned, hence your error.

You want:

if user.is_active:
            return user

Post a Comment for "Typeerror: Get_session_auth_hash() Missing 1 Required Positional Argument: 'self'"