摘要:
接口如何使用 阅读全文
摘要:
```python- 身份认证from rest_framework.authentication import BaseAuthentication- 导入自定义算法解析tokenfrom utils.TokenIssue import Token_Issueclass NewBaseAuthentication(BaseAuthentication): def authenticate(... 阅读全文
摘要:
```python from rest_framework.permissions import BasePermission class CustomPermission(BasePermission): def has_permission(self, request, view): - 权限模块工作原理 1)继承BasePermission类,重写has_permission方法 2)权限规 阅读全文
摘要:
```python from django.contrib import admin from . import models - admin注册自定义User表:密文操作密码 from django.contrib.auth.admin import UserAdmin as AuthUserAdmin class UserAdmin(AuthUserAdmin): add_fieldsets 阅读全文
摘要:
```python from rest_framework.response import Response # 二次封装Response class APIResponse(Response): def __init__(self, http_status=0, msg='ok', results=None, status=None, template_name=None, headers=No 阅读全文
摘要:
重写 settings中的配置 阅读全文