Im playing about with the django auth library, and ive come across something i dont understand.
I have a master template base.html and inside this template i have the following code:
{% if user.is_authenticated %}
Welcome {{user.username}}, <a href='/accounts/logout/'>Logout</a>
{% else %}
Welcome Guest, Please <a href='/accounts/login/'>Login</a>
{% endif %}
This is repeated on every page, in the header. After ive logged in however, on all but the login page itself, it shows the welcome guest... string, as if there is no authenticated user.
Confusingly however, the auth library appears to be doing its job elsewhere, i cant access login protected functions, and i can after ive logged in etc.
Can anyone tell me where im going wrong?
From the docs: