서버 실행하기
(venv) C:\Users\Cherry\Desktop\Instagram>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
Django version 3.0.8, using settings 'server.settings.dev'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
모든 list를 가져오는 API
[
{
"author": 1,
"title": "first",
"content": "신기하다",
"author_nickname": "cherry",
"created_at": "2021-11-11T10:43:09.051113+09:00",
"updated_at": "2021-11-11T10:43:09.051113+09:00",
"post_like": [],
"post_comment": [
{
"post": 1,
"writer": 4,
"content": "너무 신기하다",
"created_at": "2021-11-11T10:59:43.817108+09:00",
"updated_at": "2021-11-11T10:59:43.817108+09:00",
"writer_nickname": "backend"
},
{
"post": 1,
"writer": 3,
"content": "와우우우",
"created_at": "2021-11-11T11:00:12.168062+09:00",
"updated_at": "2021-11-11T11:00:12.168062+09:00",
"writer_nickname": "choco"
}
]
},
{
"author": 1,
"title": "second",
"content": "모델링 어렵다....ㅠ",
"author_nickname": "cherry",
"created_at": "2021-11-11T10:43:19.266647+09:00",
"updated_at": "2021-11-11T10:43:19.266647+09:00",
"post_like": [],
"post_comment": []
},
{
"author": 3,
"title": "배고파",
"content": "간식 줘",
"author_nickname": "choco",
"created_at": "2021-11-11T10:43:38.681635+09:00",
"updated_at": "2021-11-11T10:43:38.681635+09:00",
"post_like": [],
"post_comment": [
{
"post": 3,
"writer": 1,
"content": "1111",
"created_at": "2021-11-11T11:01:39.024705+09:00",
"updated_at": "2021-11-11T11:01:39.024955+09:00",
"writer_nickname": "cherry"
},
{
"post": 3,
"writer": 4,
"content": "2222",
"created_at": "2021-11-11T11:02:09.112316+09:00",
"updated_at": "2021-11-11T11:02:09.112316+09:00",
"writer_nickname": "backend"
}
]
},
{
"author": 4,
"title": "최고",
"content": "백엔드 최고",
"author_nickname": "backend",
"created_at": "2021-11-11T10:45:02.634218+09:00",
"updated_at": "2021-11-11T10:45:02.634218+09:00",
"post_like": [
{
"id": 1,
"created_at": "2021-11-11T11:03:25.206561+09:00",
"updated_at": "2021-11-11T11:03:25.206561+09:00",
"post": 4,
"user": 3
},
{
"id": 2,
"created_at": "2021-11-11T11:03:28.479015+09:00",
"updated_at": "2021-11-11T11:03:28.479015+09:00",
"post": 4,
"user": 4
},
{
"id": 3,
"created_at": "2021-11-11T11:03:32.296073+09:00",
"updated_at": "2021-11-11T11:03:32.296073+09:00",
"post": 4,
"user": 1
}
],
"post_comment": []
}
]
특정 데이터를 가져오는 API
{
"author": 1,
"title": "second",
"content": "모델링 어렵다....ㅠ",
"author_nickname": "cherry",
"created_at": "2021-11-11T10:43:19.266647+09:00",
"updated_at": "2021-11-11T10:43:19.266647+09:00",
"post_like": [],
"post_comment": []
}
새로운 데이터를 생성하는 API
{
"author" : 3,
"title" : "view 작성",
"content" : "view 작성하기 과제"
}
{
"author": 3,
"title": "view 작성",
"content": "view 작성하기 과제",
"author_nickname": "choco",
"created_at": "2021-11-12T01:01:58.749741+09:00",
"updated_at": "2021-11-12T01:01:58.749741+09:00",
"post_like": [],
"post_comment": []
}
특정 데이터를 업데이트하는 API
{
"author" : 3,
"title" : "view update",
"content" : "update, update"
}
{
"author": 3,
"title": "view update",
"content": "update, update",
"author_nickname": "choco",
"created_at": "2021-11-12T01:01:58.749741+09:00",
"updated_at": "2021-11-12T01:14:05.158968+09:00",
"post_like": [],
"post_comment": []
}
특정 데이터를 삭제하는 API