REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication'
]
}
path('api/token/', TokenObtainPairView.as_view()),
path('api/token/refresh/', TokenRefreshView.as_view()),
// 요청 예제
{
"username": "계정",
"password": "비밀번호"
}
// 응답 예제
{
"refresh": "리프레시 토큰",
"access": "엑세스 토큰"
}
// 요청 예제(POST)
{
"title": "제목",
"content": "내용"
}
// 응답 예제
{
"id": 1,
"title": "제목",
"content": "내용",
"author": 1
}
// 요청 예제(GET)
{}
// 응답 예제
[
{
"id": 1,
"title": "제목",
"content": "내용",
"author": 1
},
{
"id": 2,
"title": "제목",
"content": "내용",
"author": 1
},
{
"id": 3,
"title": "제목",
"content": "내용",
"author": 1
}
]
8번까지 작성을 할 수 있었다. 강의 계속 듣고 공부 열심히하면 다 작성할수 있지 않을까 해서 기록을 남겨본다