9. Sessions and Authentication
Overview
This chapter begins with a brief introduction to middleware before delving into the concepts of authentication models and session engines. You will implement Django's authentication model to restrict permissions to only a specific set of users. Then, you will see how you can leverage Django authentication to provide a flexible approach to application security. After that, you will learn how Django supports multiple session engines to retain user data. By the end of the chapter, you will be proficient at using sessions to retain information on past user interactions and to maintain user preferences for when pages are revisited.