Stripe webhooks not firing in Django app during normal checkout flow
I'm integrating Stripe with my Django app (using Django REST Framework).
I've set it up to accept POSTs, and when I use the Stripe CLI to trigger events, everything works perfectly. Example Stripe CLI command:
stripe listen --forward-to localhost:8000/webhooks/api/v1/stripe-webhook/
When I run commands like stripe trigger checkout.session.completed
I see the events in my server logs and my Django view is hit as expected:
[200] POST http://localhost:8000/webhooks/api/v1/stripe-webhook/ price.created [evt_1R]
[200] POST http://localhost:8000/webhooks/api/v1/stripe-webhook/
charge.succeeded [evt_1R]
[200] POST http://localhost:8000/webhooks/api/v1/stripe-webhook/
payment_intent.succeeded [evt_1R]
[200] POST http://localhost:8000/webhooks/api/v1/stripe-webhook/
checkout.session.completed [evt_1R]
[200] POST http://localhost:8000/webhooks/api/v1/stripe-webhook/
payment_intent.created [evt_1R]
[200] POST http://localhost:8000/webhooks/api/v1/stripe-webhook/
But when I go through my actual frontend flow (create a Checkout Session from my app, complete the payment in test mode, etc.), no webhooks are received at all.
- I see nothing in my Django logs.
- Nothing is received on my webhook endpoint.
- I also see no attempts or errors in the Stripe Dashboard's "Webhooks" section.
Things I have tried:
- Registering both URLs in the Stripe Dashboard webhook settings.
- I am using test mode and test credentials.
- Stripe CLI and triggers work perfectly.
Summary:
- Stripe CLI triggers work, real Stripe events from live app flow do not.
- No webhooks reach my server in normal payment flow, but do when triggered by CLI.
Is there anything else I can try or check?
Why would webhooks only reach my endpoint via Stripe CLI, but never from the actual payment flow?
What should I check in my Stripe Dashboard or my code?