Support for invisible widget type
Closed this issue ยท 5 comments
Thank you, Minghan, for this very useful project. Bravo! ๐
I would like to use Turnstile's invisible widget type, but it is not clear to me how to configure django-turnstile
to use the invisible widget type. Could you possibly provide some guidance?
First of all, thank you very much for your advice, this is my first issue! ๐
I browsed the turnstile docs and CloudFlare community, and as you can see, I didn't find anything specific about invisible widgets. ๐
I'm trying to decompile and read the turnstile source code to find something useful. ๐ค
Hope everything goes well. ๐
(Sorry, please excuse my English)
Let me tell you how you should change your code:
- Global Configuration
<project> / settings.py
TURNSTILE_DEFAULT_CONFIG = {
'size': 'invisible', # add it
}
or
- Local Configuration
... / forms.py
from django import forms
class ExampleForm(forms.Form):
captcha = CaptchaField(
label="captcha",
size="invisible", # add it
error_messages={
"required": "Please enter the captcha field",
"invalid": "The captcha is incorrect"
},
)
Thanks for the issue! If you are also successful, please comment and then I will close the issue~
Hey Zhang. I just wanted to say a belated thank-you for responding to my question so quickly and for answering it so thoughtfully and thoroughly. Much, much appreciated! ๐