0

My problem is very much like the one here: How do I receive Github Webhooks in Python

The difference is, I am sure about my framework, that being Django. I have been able to register webhook for a particular repository, and did port forwarded using ngrok. The Payload delivered gets a 403 response because of csrf validation error, I am not being able to resolve it. Also, how do I continually listen for the payload JSON and store it in my database as and when it comes?

The response at github webhook: https://imageshack.com/i/exZfoM8Ip

403 Forbidden as shown by ngrok: https://imageshack.com/i/ipnzhQLVp

*NOTE: Links are now down.

1 Answers1

0

There's no concept of "continually listening" in a web app, because that's exactly what web apps always do. You simply set up a URL pointing to a view.

And as the documentation says, you can exempt a view from CSRF enforcemnt by using the @csrf_exempt decorator.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895