from django.shortcuts import render, redirect, reverse

from django.views.generic import TemplateView

class IndexView(TemplateView):
    template_name = "index.html"

    def get(self, request, *args, **kwargs):
        if not self.request.user.is_authenticated:
            return redirect(reverse('login'))
        return super().get(request, *args, **kwargs)

ade34e18fc526f3d38793e8d4c9583030d13c75b
<mask token>


class IndexView(TemplateView):
    <mask token>
    <mask token>

<mask token>


class IndexView(TemplateView):
    <mask token>

    def get(self, request, *args, **kwargs):
        if not self.request.user.is_authenticated:
            return redirect(reverse('login'))
        return super().get(request, *args, **kwargs)

<mask token>


class IndexView(TemplateView):
    template_name = 'index.html'

    def get(self, request, *args, **kwargs):
        if not self.request.user.is_authenticated:
            return redirect(reverse('login'))
        return super().get(request, *args, **kwargs)

from django.shortcuts import render, redirect, reverse
from django.views.generic import TemplateView


class IndexView(TemplateView):
    template_name = 'index.html'

    def get(self, request, *args, **kwargs):
        if not self.request.user.is_authenticated:
            return redirect(reverse('login'))
        return super().get(request, *args, **kwargs)

from django.shortcuts import render, redirect, reverse

from django.views.generic import TemplateView

class IndexView(TemplateView):
    template_name = "index.html"

    def get(self, request, *args, **kwargs):
        if not self.request.user.is_authenticated:
            return redirect(reverse('login'))
        return super().get(request, *args, **kwargs)
