"Django Registration (redux) Navbar"
Bootstrap 3.3.0 Snippet by LordK1

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <nav class="navbar navbar-default navbar-static-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="{% url 'home' %}">Danamon</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="{% url 'home' %}">Home</a></li> <li><a href="{% url 'about' %}">About</a></li> <li><a href="{% url 'contact' %}">Contact</a></li> </ul> <ul class="nav navbar-nav navbar-right"> {% if request.user.is_authenticated %} <li><a href='{% url "auth_logout" %}'>Logout {{ request.user }} - {{ user }}</a></li> {% else %} <li><a href='{% url "registration_register" %}'>Register</a></li> {% endif %} </ul> <!-- Login Form --> {% if not request.user.is_authenticated and not "/accounts/login/" in request.get_full_path %} <form class="navbar-form navbar-right" method="post" action='{% url "auth_login" %}' role="search"> {% csrf_token %} <div class="form-group"> <input class="form-control" type="text" name="username" placeholder="Username"/> </div> <div class="form-group"> <input class="form-control" type="password" name="password" placeholder="Password"/> </div> <button class="btn btn-default">Login</button> </form> {% endif %} </div> <!--/.nav-collapse --> </div> </nav>
body { min-height: 2000px; } .navbar-static-top { margin-bottom: 19px; } .navbar-default .navbar-brand, .navbar-default .navbar-nav > li > a { color: #434343; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-nav > li > a:hover { color: #009164; } .navbar-default .navbar-toggle { border-color: transparent !important; } .navbar-toggle { /*background-color: #c12e2a !important;*/ }

Related: See More


Questions / Comments: