1👍
✅
Error is happening here: https://github.com/django/django/blob/stable/1.10.x/django/contrib/auth/init.py#L101
in user.pk
is user
not a user object but a str object. and underlying problem is apparently that you are redefining str
somewhere in your code as a variable or/and as a result, you are passing a string object to login()
instead of a user object
check where it is and fix it
Source:stackexchange.com