-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
django-friendly-captcha can't be used in seamless replacement to recaptcha/hcaptcha #6
Comments
Yes, I understand and had thought about that at the beginning. I decided against, since this would force me to create a new library version every time friendly captcha releases a new version of their js and css assets. As far as I know they don't support something like a "latest" version. Any ideas to deal with that? |
I would assume that they serve this particular "version" a long time compatible on server side, because it would be hardcoded in many templates around the world nowadays. I'm new to "django" so I don't know at all whether template content itself can be adjusted by config file. At least the django form code looks like not supporting injection of any HTML. |
The code changes quite often, as you can see here: https://github.com/FriendlyCaptcha/friendly-challenge/commits/master/docs/changelog.md. Injection of form assets works like described here: https://docs.djangoproject.com/en/4.1/topics/forms/media/. |
Can be but according to https://docs.friendlycaptcha.com/#/installation
an older statically pinned version will continue to work.
Thank you for the link, but haven't found any example how I can inject HTML code defined in settings.py inside the Phython form code like e.g.
|
Ok, I think I understand what you're trying to achieve. I will try to refactor the library so that I pin it with some current version of the friendly captcha static assets and make it possible to override this by some settings values. According to that you will be able to use the friendly captcha field the same way like the other ones. |
I worked on it and it went faster than expected. Can you please try, if version 0.1.7 fits your needs? |
That was quick, it's working as expected, thank you! For completness, the optional proxy support should be also added like reCaptcha (RECAPTCHA_PROXY) and hCaptcha (HCAPTCHA_PROXIES) have already built in. |
while
django-recaptcha
anddjango-hcaptcha
can be used out-of the box with a very small extension of related <form_file>.py, e.g.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/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.
The text was updated successfully, but these errors were encountered: