I am trying to add Bootstrap class to align the reCAPTCHA in the center.
How do I add a class for this in the form?
Without doing a custom CSS file or changing template file.
from Django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordResetForm, SetPasswordForm, PasswordChangeForm
from django.core.exceptions import ValidationError
from django.forms.widgets import PasswordInput, TextInput
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV2Invisible
class CustomAuthForm(AuthenticationForm):
username = forms.CharField(required=True, max_length = 50, widget=forms.TextInput(attrs={"placeholder": "Email", "class":"form-control"}))
password = forms.CharField(required=True, max_length = 50, widget=forms.PasswordInput(attrs={"placeholder":"Password", "class":"form-control"}))
captcha = ReCaptchaField(required=True)