[web2py] Re: reCAPTCHA link in online web2py book

2024-01-31 Thread chriii...@gmail.com
Hello.

Recpatcha is still working like a charm. 

Here are some examples about how to use it.

if you want to have Recaptcha in login form, set it like this:

in models.py
#import recaptcha
from gluon.tools import Recaptcha2

#enable recaptcha in login form.
auth.settings.captcha = Recaptcha2(request, public_key='key1', 
private_key='key2', label='')


If you want to use it in SQLFORM.
define some functions for convenience in models.py or in other place

ex: 
#function to be used in a form without database
def captcha_field(request=request):
w = lambda x, y: Recaptcha2(request,
'public_key',
   'private_key',
   )

return Field('captcha', 'string', label='', widget=w, default='ok')


#function to be used in a sqlform
def captcha_sqlform():
recaptcha2 = Recaptcha2(request, 'public_key', 'private_key', '')

return DIV(LABEL("", _class="form-control-label 
col-sm-3"),DIV(recaptcha2, _class="col-sm-9"), _class="form-group 
row",_name="recaptcha_form")


#append the recaptcha to sqlform
form = SQLFORM(db.table, keep_values=True)
form[0].insert(-1, captcha_sqlform())

This will add the recpatcha validation to the form.

Greetings.
Chris.

On Wednesday, January 31, 2024 at 5:46:28 AM UTC-3 snide...@gmail.com wrote:

> On Sunday, January 28, 2024 at 5:41:01 AM UTC-8 lucas wrote:
>
> anyone on this, at all?
>
>
> Sorry, I haven't used recaptcha, but I think there was a recent thread 
> about it in the py4web forum.
>
> Good luck
>
> /dps
>  
>
> On Monday, January 22, 2024 at 9:01:02 AM UTC-5 lucas wrote:
>
> hello one and all,
>
> the link for reCAPTCHA, or, "
> http://web2py.com/books/default/reference/29/recaptcha";, under the online 
> web2py book, "
> http://web2py.com/books/default/chapter/29/09/access-control#CAPTCHA-and-reCAPTCHA";,
>  
> seems to by unreferenced.
>
> is this feature still working in the latest version of web2py, 2.27.1?  is 
> it still free?  is it still good to use?
>
> thank you, lucas
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/04e3f7ae-ed7f-4c0e-aa38-1b61122b3ee6n%40googlegroups.com.


[web2py] Re: reCAPTCHA link in online web2py book

2024-01-31 Thread Dave S
On Sunday, January 28, 2024 at 5:41:01 AM UTC-8 lucas wrote:

anyone on this, at all?


Sorry, I haven't used recaptcha, but I think there was a recent thread 
about it in the py4web forum.

Good luck

/dps
 

On Monday, January 22, 2024 at 9:01:02 AM UTC-5 lucas wrote:

hello one and all,

the link for reCAPTCHA, or, "
http://web2py.com/books/default/reference/29/recaptcha";, under the online 
web2py book, "
http://web2py.com/books/default/chapter/29/09/access-control#CAPTCHA-and-reCAPTCHA";,
 
seems to by unreferenced.

is this feature still working in the latest version of web2py, 2.27.1?  is 
it still free?  is it still good to use?

thank you, lucas

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e5e29850-a6ff-4693-b16a-1e9ea0165775n%40googlegroups.com.