Issue with custom backend and forms to login

For the purpose of being comprehensive, no, it’s not necessarily why you’re getting it in your output. If your authenticate method returned just the username and not the user object, your output would have been the same. (I can see that it’s not doing that, but I wanted to point out why I needed to ask the question.)

And that’s the problem. See Writing an authentication backend, first paragraph. (Note: This has been pointed out to you before: Django's template doesn't render as expected (template language issue) - #11 by CodenameTim and Django's template doesn't render as expected (template language issue) - #13 by CodenameTim)