In template, when I use
{% if topic.creator.is_authenticated %}
Online
{% else %}
Offline
{% endif %}
the users turn out to be always onli
Yes it does. But the correct way to check if a user is logged in or not is to use : request.user.is_authenticated. This will return True if the person is logged in other wise False.
eg:
in the template:
{% if request.user.is_authenticated ==True %}
do something awesome.
in views pass request into the template.
return render('url/filename.html',{'any variable name':request})