随笔分类 - django-restframework
摘要:rest_framework自带的权限 引入 from rest_framework import permissions permissions.AllowAny 允许所有人访问 permissions.IsAuthenticated 仅允许登录的人员访问 判断条件是request.user an
阅读全文
摘要:基础的ViewSet views.py from rest_framework import viewsets from .models import Merchant from .serializers import MerchantSerializer from rest_framework.r
阅读全文
摘要:from rest_framework.views import APIView from meituan.models import Merchant from django.http import Http404 from .serializers import MerchantSerializ
阅读全文
摘要:from rest_framework.views import APIView from meituan.models import Merchant from django.http import Http404 from .serializers import MerchantSerializ
阅读全文
摘要:from rest_framework.views import APIView from meituan.models import Merchant from django.http import Http404 from .serializers import MerchantSerializ
阅读全文
摘要:模型序列化 from rest_framework import serializers from meituan.models import Merchant, class MerchantSerializer(serializers.ModelSerializer): class Meta: m
阅读全文