Website Home
Imitate the blog park: Navigation bar, left menu, middle article, right ads and so on.
First of all:
The user has the log login, if logged in, on the right side of the navigation bar to display user login information, the reverse display login, registration
<ul class= "nav navbar-nav navbar-right" > {% if request.user.is_authenticated%} #如果有用户登录 <li><a href= "{% url" AAA "Request.user.username%}" ><span class= "Glyphicon glyphicon-user" ></ span> {{request.user.nickname}}</a></li> <li class= "dropdown" > <a href= "#" class= "Dropdown-toggle" data-toggle= "dropdown" role= "button" aria-haspopup= "true" aria-expanded= " False "> Personal Center <span class=" caret "></span></a> <ul class=" Dropdown-menu "> <li><a href= "#" > My blog </a></li> <li><a href= "#" > Change Password </a ></li> <li><a href= "#" > Settings </a></li> <li role= "Sep Arator "class=" divider "></li> <li><a href="/logout/"> Logout </a></li> </ul> </li> {% Else%} <li><a href= "/login/" > Login </a></li> <l I><a href= "/register/" > registration </a></li> {% ENDIF%} </ul>
Blog Park--Home