I wanted to pass variables with the User information, that is linked to a Clients model through a OneToOneField to the django.contrib.auth.models, onto the base.html file.
So, I created a context_processors.py with the following code
from django.contrib.auth.models import User
def userData(request):
user = request.user
u = User.objects.get(username=user)
us = u.clients.first_name
uv = u.clients.avatar
return {
'u': u,
'us': us,
'uv': uv
}
Everything was working fine, until I logged out.
When I try to login again, I get the accounts/login url and get a
DoesNotExist at /accounts/login/
User matching query does not exist.