Currently working on a Django website and incorporating Bootstrap/CSS/HTML to enhance the design.
I've set up a navbar menu and want the login tab on the right side. However, despite my attempts, I'm not achieving the desired outcome:
The HTML script I have looks like this:
{% if user.is_authenticated %}
...
display all tabs
...
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url "logout" %}"><span class="glyphicon glyphicon-log-out"></span> Logout </a></li>
{% else %}
<li><a href="{% url "login" %}"><span class="glyphicon glyphicon-log-out"></span> Login </align></a></li>
{% endif %}
</ul>
For authenticated users:
https://i.sstatic.net/qFQAw.png
For non-authenticated users:
https://i.sstatic.net/Ojvj3.png
As a beginner in HTML/CSS/Bootstrap, any suggestions on how to achieve this?
Thank you
EDIT:
Full HTML script with multiple {% user.is_authenticated %}
:
<!--DOCTYPE html -->
<html>
<head>
{% load staticfiles %}
<title> DatasystemsEC - Home </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{% static 'css/Base.css' %}"/>
</head>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://www.test.fr/"> Software </a>
</div>
<ul class="nav navbar-nav">
<li><a href="{% url "home" %}"> <span class="glyphicon glyphicon-home"></span> Home </a></li>
{% if user.is_authenticated %}
<li><a href="{% url "profile" %}"> Profile </a></li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %}
<li><a href="{% url "logout" %}"><span class="glyphicon glyphicon-log-out"></span> Logout </a></li>
{% else %}
<li><a href="{% url "login" %}"><span class="glyphicon glyphicon-log-in"></span> Login </a></li>
{% endif %}
</ul>
</div>
</nav>
{% block content %}
{% endblock content %}
</html>