1👍
✅
You need to assign the field to form.fields
, not just form
.
However this is not really the way to do this. Instead, you should make all your forms inherit from a shared parent class, which defines the captcha
field.
0👍
Continuing from a comment, have a base class inherit from django.forms.Form
, and subclass it for all the forms you want a captcha
field on;
from captcha.fields import ReCaptchaField
from django.forms import Form
class CaptchaMixin():
captcha = ReCaptchaField()
class ActualForm(CaptchaMixin, Form):
pass
- Django Oscar doesn't see products
- Best Practice to handle form submission status pages reload
- Django: limiting model instance based on foregin key
- Signals VS Celery task
- Django on Google App Engine- How to import/use 3rd party libraries?
Source:stackexchange.com