Skip to content

백창인 과제 03 제출#94

Open
nuagenic wants to merge 14 commits into
wafflestudio:mainfrom
nuagenic:week3
Open

백창인 과제 03 제출#94
nuagenic wants to merge 14 commits into
wafflestudio:mainfrom
nuagenic:week3

Conversation

@nuagenic

@nuagenic nuagenic commented Nov 21, 2023

Copy link
Copy Markdown

http://waffleblog-env.eba-3j9eg2uq.us-west-2.elasticbeanstalk.com/api/blog/posts/

API Endpoint

  • /api/auth/register/ : request body 에 usernamepassword를 입력하면 가입 완료
  • /api/auth/token/: request body 에 usernamepassword를 입력하면 token 발급. 이후 Header에 token을 담아 authentication 진행
  • 참고로 만들어 둔 admin 계정 token: a9fdf5c2debcba7af039f981c299b0ca36937cd2
  • /api/blog/posts : 포스트 목록 확인 가능. commentstags를 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>/ : 해당 태그가 달린 댓글 조회

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown

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):

Copy link
Copy Markdown

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):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListCreateAPIView 를 상속받는게 의도하신 구조와 맞지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants