Answers for "how to add decorators with class in django"

0

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):
    @method_decorator(login_required(login_url='login'))
    def get(self, request):
      .......
Posted by: Guest on July-26-2021

Code answers related to "how to add decorators with class in django"

Python Answers by Framework

Browse Popular Code Answers by Language