摘要: 在 app 目录下创建 utils 目录,并创建 auth.py 和 permission.py 文件 auth.py: from rest_framework.authentication import BaseAuthentication from drf import models from 阅读全文
posted @ 2021-01-16 14:33 Sch01aR# 阅读(112) 评论(0) 推荐(0) 编辑
摘要: views.py: from django.http import JsonResponse from rest_framework.views import APIView ORDER_DICT = { 1: { "commodity": "Phone", "price": 3600, "date 阅读全文
posted @ 2021-01-16 11:27 Sch01aR# 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 在 app 目录下创建 utils 目录,并创建 auth.py auth.py: from rest_framework.authentication import BaseAuthentication # 用于全局认证 class GlobalAuthentication(BaseAuthent 阅读全文
posted @ 2021-01-16 10:59 Sch01aR# 阅读(177) 评论(0) 推荐(0) 编辑