ListAPIView
-
[Django] Django REST API (3) - REST API CRUDPhthon/Django 2019. 12. 28. 21:35
1. R(Post List) # restful/serializers.py from rest_framework import serializers from .models import posts class postsListSerializer(serializers.ModelSerializer): class Meta: model = posts #모델 설정 fields = ('id', 'title', 'content', 'writer') #필드 설정 restful/views.py from rest_framework import generics from .serializers import * from .models import posts class postsList(generics.ListAPIView): query..