01 2021 档案

摘要:rest_framework自带的权限 引入 from rest_framework import permissions permissions.AllowAny 允许所有人访问 permissions.IsAuthenticated 仅允许登录的人员访问 判断条件是request.user an 阅读全文
posted @ 2021-01-02 14:17 xsan 阅读(603) 评论(0) 推荐(0) 编辑
摘要:基础的ViewSet views.py from rest_framework import viewsets from .models import Merchant from .serializers import MerchantSerializer from rest_framework.r 阅读全文
posted @ 2021-01-01 17:44 xsan 阅读(179) 评论(0) 推荐(0) 编辑
摘要:from rest_framework.views import APIView from meituan.models import Merchant from django.http import Http404 from .serializers import MerchantSerializ 阅读全文
posted @ 2021-01-01 16:44 xsan 阅读(123) 评论(0) 推荐(0) 编辑
摘要:from rest_framework.views import APIView from meituan.models import Merchant from django.http import Http404 from .serializers import MerchantSerializ 阅读全文
posted @ 2021-01-01 16:43 xsan 阅读(116) 评论(0) 推荐(0) 编辑