19.5 Adding Login and Logout Features

The goal of the rest of this chapter is to build two webpages: one to log in the user and the other to log out the user. We know that Django’s auth app supplies two views to do just this: login() and logout(). Django even has a URL configuration that uses these views. However, we quickly find out that using the URL configuration poses a few problems, and we switch to using the function views directly.

Before any of that, however, we dive into the shell to interact with the User model and see how it works.

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.