Django registration and ReCaptcha integration - how to pass a custom IP address

New to django and trying to configure django-registration 0.8 with recaptcha-client. I went for advice posted in response to this question .

I used the custom form and custom backend from this post, and the widget and field from this tutorial . My form is displayed correctly with the recaptcha widget, but when I submit it, it gives an error about the missing IP address. What is the best way to pass an IP address using django registration?

+3
source share
1 answer

, , reCaptcha django.

- initial={'captcha': request.META['REMOTE_ADDR']} , RecaptchaRegistrationForm.

, register/views.py.

- . urls.py , , /backends/default/, .

+2

Source: https://habr.com/ru/post/1742765/


All Articles