-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
백창인 과제 03 제출 #94
base: main
Are you sure you want to change the base?
백창인 과제 03 제출 #94
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요런 코드는 github PR 에선 제외해주시는게 좋습니다 ㅎㅎ
return obj.description[:300] | ||
|
||
|
||
class PostCreateSerializer(serializers.ModelSerializer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이마 메서드별로 Serializer 를 따로 만드실 필요는 없을꺼에요
permission_classes = [IsAdminOrOwnerOrReadOnly] | ||
|
||
|
||
class TagListCreateView(generics.ListAPIView): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ListCreateAPIView 를 상속받는게 의도하신 구조와 맞지 않을까요?
http://waffleblog-env.eba-3j9eg2uq.us-west-2.elasticbeanstalk.com/api/blog/posts/
API Endpoint
/api/auth/register/
: request body 에username
과password
를 입력하면 가입 완료/api/auth/token/
: request body 에username
과password
를 입력하면 token 발급. 이후 Header에 token을 담아 authentication 진행a9fdf5c2debcba7af039f981c299b0ca36937cd2
/api/blog/posts
: 포스트 목록 확인 가능.comments
및tags
를 nested serializer로 작업./api/blog/posts/<int:pk>
: 포스트 id를 활용하여 상세 페이지 확인/api/blog/comments/
: 댓글 전체 목록 확인 가능/api/blog/comments/posts/<int:post_id>/
: post id에 해당하는 post에 달린 comments만 확인/api/blog/tags/
: 태그 전체 목록 확인 가능/api/posts/<str:content>/
: 해당 태그가 달린 포스트 조회/api/comments/<str:content>/
: 해당 태그가 달린 댓글 조회