From the course: Django Essential Training

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Finishing touches

Finishing touches

- [Instructor] Okay, we are so close. It is time to add it all together. So let's go to static, templates, base.html. And then in here what we're going to do is add a nav, so a navigation bar. We need a couple of classes here. So let's add navbar navbar-dark, and a dark background. Okay, inside of it, we're going to need a div. And this div must have a class, ms-auto. And then in here we can add a link. Okay, so let's add a link to the login page. So in here, let's add href, that has the command URL, login, and then some classes here. Let's make this a button. So btn btn-outline-light. And let's add some space in here. Okay, let's try this out. Amazing. So you can see here that now we have a Login button, but it doesn't really make sense, you have a Login button for a logged in user. So we can see here that we have a logged in user. So let's add some logic to change this. So if it's an authenticated user, we want to display the logout URL, not the login. So in here, what we can do is…

Contents