I have a Teacher/Student django app. When a Teacher is logged in, and wants to see the Student's progress, this is what I am doing:
In my template, I have:
Teacher: {{ user.username }}
Student Info:
I get the correct Student Info, but I do not see the Teacher's username. My template also has navigation based on whether the user is logged in or not and for this page, I get the not_logged_in view of my navigation bar.
However, now if I browse over to other pages, which also display Teacher: {{ user.username }}, the username is seen, and the logged_in navigation bar is displayed.
So it is just for this one template that confused with the User though the actual user login (Teacher) is valid and retained.
Could someone please explain what is going wrong here?
Pasting my comment since it turns out it was the answer.
No. There is no magic like that. While we can't tell since you haven't posted your code, my guess is that this one view doesn't use say RequestContext
and the user variable is simply not in the context.