-> 이벤트가 발생해서 웹훅에 설정된 url로 POST 요청 자체는 하는듯.
그러나 307 에러가 발생함.
내 생각은, webhook 이벤트 트리거(github 리파지토리에 push) -> web hook에 설정된 api url로 POST 요청-> 해당 url에 따라 views에서 프린트 동작이 일어나야 한다고 생각함..!!
그런데 200이 아니라 307 에러 발생. view(컨트롤러)까지 안 감.
307 에러는 같은 리소스에서 POST방식으로 새로운 위치에 요청하여 리다이렉트할 때 발생하는데 이 때 그 새 location이 임시 위치일 경우...
애초에 redirect 가 되면 안된다. 이벤트발생 -> post로 해당 url에 요청 -> response 받음. 이거만 되면됨
github에 push를 하면 사용중인 서버의 webhook으로 빌드 시작 요청을 보냄 -> 요청 url 끝에 /을 붙이면 그 url로 리다이렉트 됨.
-> url 끝에 /을 붙여야 한다고 함.
-> 그래도 안됨..ㅇ<-<
악!! 바보같이 포트번호를 안붙임..
-> 도메인으로 하니 안되고 공인 ip로 하니 됬음
그러나
RuntimeError: You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 147.47.67.225:8005/api/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
발생.
https://somjang.tistory.com/entry/FastAPI-307-temporary-redirect-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95-Python
https://lng1982.tistory.com/351
https://stackoverflow.com/questions/49848884/github-webhook-with-jenkins-return-302-found