My form class
from django import forms
class Form(forms.Form):
your_name = forms.CharField(label='Your name ', max_length=100)
My app file __init__.py
from django import forms
from my_app.forms import Form
from captcha.fields import ReCaptchaField
def register(form):
form.captcha=CaptchaField()
register(Form)
Code in __init__.py add an attribute captcha but it is not on the page.
I tried so
My form class
from django import forms
class Form(forms.Form):
your_name = forms.CharField(label='Your name ', max_length=100)
captcha=CaptchaField()
It works, but I have a different! I want to add a сaptcha many forms. I want to add the captcha without changing the form classes. I want to change the form classes during initialization. How to do it???
django.forms.Form) with thecaptchaattribute solve your problem?