摘要: 操作步骤 第一步: 写一个类,继承BasePermission,重写has_permission,判断如果有权限,返回True,如果没有权限,返回False 第二步:局部使用和全局使用 局部使用 class BookDetailView(GenericViewSet, CreateModelMixi 阅读全文
posted @ 2022-04-08 23:16 那就凑个整吧 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 登录功能 models.py from django.db import models # Create your models here. class User(models.Model): username = models.CharField(max_length=32) password = 阅读全文
posted @ 2022-04-08 19:07 那就凑个整吧 阅读(35) 评论(0) 推荐(0) 编辑