一、CBV添加装饰器 views.py: from django.shortcuts import render, HttpResponse, redirect # Create your views here. from django.views import View """ FBV添加装饰器 """ def login_auth(func): def inner(request