python - How to validate Google reCAPTCHA v2 in django -
i have been trying use google recaptcha on website i've been making. captcha loads on webpage i've been unable validate using several methods. i've tried recaptcha validation using method given @ how use python plugin recaptcha client validation? think it's outdated no longer works , referring challenges whereas 1 i'm trying use new 'checkbox' recaptcha v2 google or maybe need make changes in settings after installing recaptcha-client or django-recaptcha.
please help!
there third-party django app implement new recaptcha v2 here:
https://github.com/imaginarylandscape/django-nocaptcha-recaptcha
after installing it, add following lines following files:
# settings.py norecaptcha_site_key = <the google provided site_key> norecaptcha_secret_key = <the google provided secret_key> installed_apps = ( .... 'nocaptcha_recaptcha' ) #forms.py nocaptcha_recaptcha.fields import norecaptchafield class yourform(forms.form): ..... captcha = norecaptchafield() # in template, add following script tag: <script src="https://www.google.com/recaptcha/api.js" async defer></script>