Forums

Deploy code with GitHub webhook on password protected site on pythonanywhere

Hello there,

I dont know if this is the right place for this, but I think it could help someone in the future.

I tried to set up a cd pipeline for a django webapp hostet at pythonanywhere. I setted up a new view function to receiving the webhooks sended from GitHub. In GitHub I created a webhook to trigger a pull on the server side repo. The webhook receives everytime a 401 error. After a long time of debugging I figured out, that the webapp is behind the pythonanywhere side <strong>password protection</strong> (a function that I appreciate btw). After turning the protection off, everything worked fine. That makes sense, because the webhook isnt able to login in the popup, but it tooked me a while to figured that out, lesson learned (the access log was the key).

Now I will set up the cd pipeline with ssh. Its not that elegant but I want to use the password protection function in the future.

This is maybe something for a feature request or is there a workaround?

Keep on doing develop the plattform

greets jules

Check the Github documentation about how to include an HTTP basic auth username and password in your webhook requests.