📜  如何在 django 中添加带有类的装饰器 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:07.043000             🧑  作者: Mango

代码示例1
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):
      .......