how to add decorators with class in django

from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required

#AS example
class ProfileView(View):
    def get(self, request):

Here is what the above code is Doing:
1. We import the login_required decorator from django.contrib.auth.decorators.
2. We import the method_decorator from django.utils.decorators.
3. We import the View class from django.views.generic.
4. We create a class called ProfileView that inherits from the View class.
5. We decorate the get method with the method_decorator and pass in the login_required decorator.
6. We pass in the login_url argument to the login_required decorator.
7. We define the get method.