Good night, welcome back again in Python Learning, this time i wanna share simply tutorial how to Install Django Recaptcha from Google reCAPTCHA.

There is using Django reCAPTCHA, for more you can checkout at this repository

  1. Makesure you already has the form before setup Django reCAPTCHA.
  2. Installing django from pip: $ pip install django-recaptcha or directly from branch.
  3. Add captcha to your INSTALLED_APPS on
  1. Put some keys from Google reCAPTCHA, for example like this in you
RECAPTCHA_PUBLIC_KEY = '76wtgdfsjhsydt7r5FFGFhgsdfytd656sad75fgh'
RECAPTCHA_PRIVATE_KEY = '98dfg6df7g56df6gdfgdfg65JHJH656565GFGFGs'

5. Usage Django reCAPTCHA for example like this in your

from django import forms
from member.models import Member
from captcha.fields import ReCaptchaField

class RegisterForm(forms.ModelForm):
    captcha = ReCaptchaField(attrs={'theme' : 'clean'})

    class Meta:
        model = Member
        fields = ['username', 'email', 'password']

Thereis basiclly how to install and usage your Django reCAPTCHA, and will automatically manage error response or success response. Simply right? laugh

for more usage, you can checkout on this repository:

146 7 7 0