摘要: 视图函数内书写如下代码: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.request_action = None def initialize_request(self, request, * 阅读全文
posted @ 2024-01-04 21:11 wellplayed 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 自定义表签发token 不通过auth_user表,而是通过自定义表实现签发token 代码如下: 表模型: class UserInfo(models.Model): username = models.CharField(max_length=32) password = models.Char 阅读全文
posted @ 2024-01-04 16:35 wellplayed 阅读(20) 评论(0) 推荐(0) 编辑
摘要: restful规范(10条) 1 数据的安全保障:url链接一般都采用https协议进行传输 -https是:http+ssl 安全的超文本传输协议 2 接口特征表现:在API地址中带接口标识,咱们一般放在地址栏中(放在域名中) https://api.baidu.com https://www.b 阅读全文
posted @ 2024-01-04 09:23 wellplayed 阅读(8) 评论(0) 推荐(0) 编辑