A Django application demonstrating Byebot integration.
pip install -r requirements.txtEdit the values in byebot_demo/settings.py:
BYEBOT_API_KEY = "your-api-key"
BYEBOT_SITE_KEY = "your-site-key"python manage.py runserverVisit http://localhost:8000
-
Frontend: The widget is loaded via
<script src="https://challenge.byebot.de/ray/widget.js">. A div withclass="captcha-widget"anddata-sitekeyattribute renders the CAPTCHA. -
Token Submission: On verification, the widget adds a hidden
byebot-tokenfield to the form. -
Server Validation: POST the token to
/validate_token:
response = requests.post(
"https://challenge.byebot.de/validate_token",
json={"api_key": BYEBOT_API_KEY, "token": token}
)
# 200 OK = valid tokenbyebot_demo/settings.py- Django settings with Byebot configurationcaptcha_demo/validators.py- Token validation servicecaptcha_demo/views.py- Form handling and CAPTCHA validationcaptcha_demo/templates/captcha_demo/index.html- Login form with CAPTCHA widgetcaptcha_demo/templates/captcha_demo/result.html- Success page