Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Create a restricted view in Django that only allows logged-in users to access a specific page. If a user isn't logged in, they should be sent to the login page. Fill in the blanks to complete the code for this view.Built-in and custom mixins for Class Based Views
Guardians of the secret page
Report a typo
Fill in the gaps with the relevant elements
from django.contrib.auth.mixins import
from django.views.generic import
class RestrictedView(LoginRequiredMixin, TemplateView):
= 'restricted_page.html'
= '/login/'
= 'next'Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.