O'Reilly logo

Django: Visual QuickPro Guide by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Logging Users In and Out

Django lets you keep track of who’s logged in on your site, and you can track users from page to page, as you’ll see in this chapter. Here, we’re going to create an application that lets users log in, greets them by name when they do, and lets them log out.

The application is named login, and it will consist of three pages: a main page that greets users by name if they’re logged in or, if they’re not logged in, invites them to log in; a login page with text fields for username and password; and a logout page (which is actually not a page at all—it’s just a view that logs users out and returns them to the main page).

So when a user opens the application, the user will be invited to log in. When the user logs in, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required