Computer scienceBackendDjangoDjango fixes

Built-in and custom mixins for Class Based Views

Theory

Guardians of the secret page

Report a typo
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.
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'
return_field_nameLoginRequiredMixinTemplateViewlogin_urlAuthRequiredMixinredirect_field_nametemplate_nameFormViewtemplate_pathauth_url

Create a free account to access the full topic