{% if user.is_authenticated %}
<a href="{% url django.contrib.auth.views.logout %}">Logout</a>
{% else %}
<a href="{% url register %}">Sign Up</a>
</li>
<li>
<a href="{% url django.contrib.auth.views.login %}">Login</a>
{% endif %}
Add a code snippet to your website: www.paste.org