Workshop
The workshop consists of a set of questions and answers designed to solidify your understanding of the material covered in this hour. Try answering the questions before looking at the answers.
Quiz
1. | What setting needs to be modified to enable middleware applications? |
2. | Where in a middleware application would you put code to modify the arguments that will be passed to the view function? |
3. | Where in a middleware application would you put code to track the size of responses? |
4. | Which built-in middleware application enables you to access the user object in the view function? |
Quiz Answers
1. | The MIDDLEWARE_CLASSES setting in settings.py |
2. | In the process_view() function |
3. | In the process_response() function |
4. | The django.contrib.auth.middleware.AuthenticationMiddleware application |