之前我们在进行用户校验的时候,总是从数据库中获取数据,然后再进行对比,就像如下这样: def login(request): if request.method == "POST": user = request.POST.get("user") pwd = request.POST.get("pwd") ret = models.user_info.objects.filter(user=user,pwd=pwd) if ret: reques…
django rest framework用户认证 进入rest framework的Apiview @classmethod def as_view(cls, **initkwargs): """ Store the original class on the view function. This allows us to discover information about the view when we do URL reverse lookups. Used fo…