Challenge: AuthMixin
Task
Swipe to start coding
Let's make your code more flexible.
- Define the
AuthMixinclass. - Cut the
loginandlogoutmethods from theUserclass and insert them into theAuthMixinbody. - Move the
is_authenticatedclass attribute to theAuthMixin. - Inherit the
Userclass from theAuthMixin.
Note
After performing all the actions, you will have an authorization mixin (
AuthMixin) that can be used for different user classes.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 3
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2.78
Challenge: AuthMixin
Swipe to show menu
Task
Swipe to start coding
Let's make your code more flexible.
- Define the
AuthMixinclass. - Cut the
loginandlogoutmethods from theUserclass and insert them into theAuthMixinbody. - Move the
is_authenticatedclass attribute to theAuthMixin. - Inherit the
Userclass from theAuthMixin.
Note
After performing all the actions, you will have an authorization mixin (
AuthMixin) that can be used for different user classes.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 3
single