Skip to content

django-friendly-captcha can't be used in seamless replacement to recaptcha/hcaptcha #6

@pbiering

Description

@pbiering

while django-recaptcha and django-hcaptcha can be used out-of the box with a very small extension of related <form_file>.py, e.g.

...
+# CAPTCHA support
+from django.conf import settings
+from captcha.fields import ReCaptchaField
+from hcaptcha.fields import hCaptchaField
...

class Form(forms.Form):
...
+    # CAPTCHA support
+    captcha_service = getattr(settings, 'CAPTCHA_SERVICE', None)
+    if captcha_service == 'recaptcha':
+        captcha = ReCaptchaField()
+    elif captcha_service == 'hcaptcha':
+        hcaptcha = hCaptchaField()
...

This is not working with this django-friendly-captcha as it is required to adjust the templates to inject the required script "assets" as mentioned here: https://pypi.org/project/django-friendly-captcha/

<script type="module" src="https://unpkg.com/friendly-challenge@0.9.8/widget.module.min.js" async defer></script>
<script nomodule src="https://unpkg.com/friendly-challenge@0.9.8/widget.min.js" async defer></script>

I would assume other FRC implementations have this hardcoded in templates, so for an easy replace-to-use I would suggest also to implement this in same way as recaptcha/hcaptcha have done this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions