Thanks to some feedback here and on Pythonanywhere, I've been able to solve this issue.
I had narrowed it down to a problem passing the HTML since the login works correctly on the /accounts/login/ page. I found out that the logging in from the header worked only on the /accounts/login/, but the other pages it did not, so that meant there definitely was a problem passing to the page.
The problem ended up being that I had the input property named "action", when it should have been "formaction". I knew it was really close and it would be something dumb like that :-)