from django.utils.decorators import method_decorator

1、在post 或 get方法 添加
@method_decorator(装饰器)

2、给类添加装饰器
@method_decorator(装饰器, name="")
这里的name等于get 或 post

 

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2021-06-26
  • 2021-08-07
  • 2021-08-21
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-31
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2021-07-23
相关资源
相似解决方案