diff --git a/README.rst b/README.rst index 263e9c1..048c6b3 100644 --- a/README.rst +++ b/README.rst @@ -137,6 +137,16 @@ field to the form designer. For everything else read through the django-recaptcha readme. +Simple Captcha +============== + +To enable `django-simple-captcha `__ install +`django-simple-captcha `__ and add +``captcha`` to your ``INSTALLED_APPS`` as described in the documentation for +``django-simple-captcha``. This will automatically add a "Simple Captcha" +field to the form designer field types. + + Override field types ==================== diff --git a/form_designer/default_field_types.py b/form_designer/default_field_types.py index e3f417b..5fbf6c9 100644 --- a/form_designer/default_field_types.py +++ b/form_designer/default_field_types.py @@ -102,3 +102,19 @@ def require_choices(field): "field": partial(ReCaptchaField, widget=ReCaptchaV3), } ) + + +# Add django-simple-captcha field if available +if apps.is_installed("captcha"): # pragma: no cover + try: + from captcha.fields import CaptchaField + except ImportError: + pass + else: + FIELD_TYPES.append( + { + "type": "simple captcha", + "verbose_name": _("Simple CAPTCHA"), + "field": CaptchaField + } + )