{% if request.user.username %}

Hi, {{ user.username | title }}

{% else %}

Hi, User

{% endif %}