wafflestudio/seminar-2020

simple router, @action 에 관한 질문

Aperta

#207 aperta il 28 set 2020

 (6 commenti) (0 reazioni) (0 assegnatari)Python (49 fork)auto 404
HW2backendgood first issuequestion

Metriche repository

Star
 (27 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

simple router 에 대하여 이해했다고 생각했는데, 아직인걸까요?

seminar 참여 url 을 만들고 있는데, 아래와 같이 하였더니

    # seminar views.py
    # POST /api/v1/seminar/{seminar_id}/user/ : seminar 참여

    @action(detail=True, methods=['POST'], url_path='user')
    def enter_seminar(self, request, pk=None):

Postman으로 post http://127.0.0.1:8000/api/v1/seminar/1/user/ 를 보내봤더니 "detail": "Method \"POST\" not allowed." 에러가 떴습니다.. 코드를 어떻게 수정해야할까요?

Guida contributor