Skip to content

qqri/django-rest-framework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Rest Framework 과제

유의사항

구현 스펙

1. 모든 'Post'의 list를 가져오는 API

  • url: api/posts/

  • method: GET

    결과 예시)

    [
        {
            "id": 1,
            "comment": [
                1,
                2,
                3
            ],
            "text": "예시 포스트1",
            "likes_count": 123,
            "created_at": "2019-09-30T00:12:54.190364+09:00",
            "updated_at": "2019-09-30T00:12:54.190393+09:00"
        },
        {
            "id": 2,
            "comment": [
                4,
                5
            ],
            "text": "예시 포스트2",
            "likes_count": 22,
            "created_at": "2019-09-30T00:17:59.223263+09:00",
            "updated_at": "2019-09-30T00:17:59.223329+09:00"
        },
        {
            "id": 3,
            "comment": [
                6,
                7
            ],
            "text": "예시 포스트3",
            "likes_count": 54,
            "created_at": "2019-09-30T00:18:30.796290+09:00",
            "updated_at": "2019-09-30T00:18:30.796335+09:00"
        }
    ]
    

2. 새로운 'Post'를 create 하도록 요청하는 API

  • text 값을 담아 보내면 해당 값을 text field에 저장하고 있는 Post 생성
    • url: api/posts/
    • method: POST
    • body: {"text": "새로운 post"}

Tip

https://www.django-rest-framework.org/api-guide/generic-views/
https://www.django-rest-framework.org/api-guide/serializers/

About

django rest framework를 연습하기 위한 레포지토리입니다.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%