引入method_decorator模块
1,直接在类上加装饰器
@method_decorator(test,name=‘dispatch’)
class Loginview(view)
2,直接在处理的函数前加装饰器
@method_decorator(test)
def post(self,request,*args,**kwargs):
pass
引入method_decorator模块
1,直接在类上加装饰器
@method_decorator(test,name=‘dispatch’)
class Loginview(view)
2,直接在处理的函数前加装饰器
@method_decorator(test)
def post(self,request,*args,**kwargs):
pass