How do I use 'is not None' in Django Templates?

Viewed 12432

I want to customize the greeting on my homepage so it's whether:

When logged in and entered first name:

John! Where do you want to go?

else:

Where do you want to go?

This is my template:

 {% if user.is_authenticated and not firstname_of_logged_user == None%}
 <h1 class="text-center" id="extraglow">{{firstname_of_logged_user}}! where do 
 you want to go?</h1></label>
{%else%}
<h1 class="text-center" id="extraglow">where do you want to go?</h1></label>
                                {%endif%}

However, it doesn't seem to pick up the "not None" part because if the user is logged in but didn't enter first name it shows like this:

! where do you want to go?

and if I say:

firstname_of_logged_user is not None

it says an error:

Unused 'is' at end of if expression.

Seems like an easy thing but it's not working. What's wrong? Cheers!

3 Answers
Related