{% if user.is_authenticated %}
-<span class="user_name">{{ user.get_full_name }}</span> |
-<a href='{% url django.contrib.auth.views.logout %}?next_page={{request.get_full_path}}'>Wyloguj</a>
+<span class="user_name">{{ user.username }}</span> |
+<a href='{% url logout %}?next={{request.get_full_path}}'>Wyloguj</a>
{% else %}
-<a href='{% url django.contrib.auth.views.login %}?next_page={{request.get_full_path}}'>Logowanie</a>
+{% url login as login_url %}
+{% ifnotequal login_url request.path %}
+ <a href='{{ login_url }}?next={{request.get_full_path}}'>Logowanie</a>
+{% endifnotequal %}
+
{% endif %}