-
-
Notifications
You must be signed in to change notification settings - Fork 82
Django example #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Django example #148
Conversation
Reviewer's GuideIntroduces a new Django integration example in the README to demonstrate setting up a webhook endpoint with CSRF exemption and method handling using the WHATSAPP service. Sequence diagram for Django WhatsApp webhook endpoint handlingsequenceDiagram
actor User
participant DjangoView as "Django whatsapp_endpoint view"
participant WhatsAppService as "WHATSAPP service"
User->>DjangoView: HTTP GET /whatsapp_endpoint
DjangoView->>WhatsAppService: webhook_challenge_handler(verify_token, challenge)
WhatsAppService-->>DjangoView: (response_content, status_code)
DjangoView-->>User: HttpResponse(response_content, status_code)
User->>DjangoView: HTTP POST /whatsapp_endpoint
DjangoView->>WhatsAppService: webhook_update_handler(update, hmac_header)
WhatsAppService-->>DjangoView: (response_content, status_code)
DjangoView-->>User: HttpResponse(response_content, status_code)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Adjust the require_http_methods decorator to use the positional argument (e.g. require_http_methods(["GET", "POST"])) instead of the named 'request_method_list' to match Django’s API.
- Add a quick example of how to wire this view into urls.py so users see how to route the whatsapp_endpoint in their Django URL configuration.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Adjust the require_http_methods decorator to use the positional argument (e.g. require_http_methods(["GET", "POST"])) instead of the named 'request_method_list' to match Django’s API.
- Add a quick example of how to wire this view into urls.py so users see how to route the whatsapp_endpoint in their Django URL configuration.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Hi @timkofu — thanks so much for this excellent contribution! 🙏 |
|
Hi @david-lev
Yes of course. That is perfect. This is a great software, thanks for making it. |
Hi,
I added a Django example to README.md
Summary by Sourcery
Documentation: