Re: [web2py] Using Recaptcha

2014-02-25 Thread horridohobbyist
Whoa! That works.

So the gluon.tools documentation was erroneous. Their prototype did not 
include 'request', at least, not in the preamble at the top.

Thanks.


On Monday, 24 February 2014 23:14:32 UTC-5, Kiran Subbaraman wrote:

  Include request in the parameters, and see if that works.
 Recaptcha(request, )

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On Tue, 25-02-2014 6:40 AM, horridohobbyist wrote:
  
 I'm trying to use Recaptcha. I'm following the instructions given here: 
 http://www.web2py.com/book/default/chapter/09#CAPTCHA-and-reCAPTCHA 

  However, when I try to execute the form, I get this error:
  type 'exceptions.AttributeError' 'NoneType' object has no attribute 
 'env' 
  
 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 217, in restricted
 exec ccode in environment
   File 
 /home/www-data/web2py/applications/miramar_contact/controllers/default.py 
 https://67.213.70.251/admin/default/edit/miramar_contact/controllers/default.py,
  line 111, in module
   File /home/www-data/web2py/gluon/globals.py, line 372, in lambda
 self._caller = lambda f: f()
   File 
 /home/www-data/web2py/applications/miramar_contact/controllers/default.py 
 https://67.213.70.251/admin/default/edit/miramar_contact/controllers/default.py,
  line 41, in index
 TR(T('Enter what you 
 see:'),Recaptcha(public_key='6LcRI-8SAAwNGmVIDpB_E45iurpVd7Mh5H2g',private_key='6LcRI-8SAHJon4JWF6nAErt_B4kEy-lXBxH5',use_ssl=True,error_message='invalid',label='Verify:',options='')),
   File /home/www-data/web2py/gluon/tools.py, line 757, in __init__
 self.remote_addr = request.env.remote_addr
 AttributeError: 'NoneType' object has no attribute 'env'

  
  I followed the instructions to the letter. I inserted the following in 
 my form:

  Recaptcha(public_key='my public key',private_key='my private 
 key',use_ssl=True,error_message='invalid',label='Verify:',options='')
  
  I don't know what I'm missing. Is the web2py book missing something, 
 too? Methinks it is.

  Thanks.
  -- 
 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+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.


  

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Using Recaptcha

2014-02-24 Thread horridohobbyist
I'm trying to use Recaptcha. I'm following the instructions given 
here: http://www.web2py.com/book/default/chapter/09#CAPTCHA-and-reCAPTCHA

However, when I try to execute the form, I get this error:
type 'exceptions.AttributeError' 'NoneType' object has no attribute 'env'

Traceback (most recent call last):
  File /home/www-data/web2py/gluon/restricted.py, line 217, in restricted
exec ccode in environment
  File 
/home/www-data/web2py/applications/miramar_contact/controllers/default.py 
https://67.213.70.251/admin/default/edit/miramar_contact/controllers/default.py,
 line 111, in module
  File /home/www-data/web2py/gluon/globals.py, line 372, in lambda
self._caller = lambda f: f()
  File 
/home/www-data/web2py/applications/miramar_contact/controllers/default.py 
https://67.213.70.251/admin/default/edit/miramar_contact/controllers/default.py,
 line 41, in index
TR(T('Enter what you 
see:'),Recaptcha(public_key='6LcRI-8SAAwNGmVIDpB_E45iurpVd7Mh5H2g',private_key='6LcRI-8SAHJon4JWF6nAErt_B4kEy-lXBxH5',use_ssl=True,error_message='invalid',label='Verify:',options='')),
  File /home/www-data/web2py/gluon/tools.py, line 757, in __init__
self.remote_addr = request.env.remote_addr
AttributeError: 'NoneType' object has no attribute 'env'


I followed the instructions to the letter. I inserted the following in my 
form:

Recaptcha(public_key='my public key',private_key='my private 
key',use_ssl=True,error_message='invalid',label='Verify:',options='')

I don't know what I'm missing. Is the web2py book missing something, too? 
Methinks it is.

Thanks.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Using Recaptcha

2014-02-24 Thread Kiran Subbaraman

Include request in the parameters, and see if that works.
Recaptcha(request, )


Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 25-02-2014 6:40 AM, horridohobbyist wrote:
I'm trying to use Recaptcha. I'm following the instructions given 
here: http://www.web2py.com/book/default/chapter/09#CAPTCHA-and-reCAPTCHA


However, when I try to execute the form, I get this error:


type 'exceptions.AttributeError' 'NoneType' object has no
attribute 'env'

Traceback(most recent call last):
   File/home/www-data/web2py/gluon/restricted.py,line217,inrestricted
 execccodeinenvironment
   File/home/www-data/web2py/applications/miramar_contact/controllers/default.py  
https://67.213.70.251/admin/default/edit/miramar_contact/controllers/default.py,line111,inmodule
   File/home/www-data/web2py/gluon/globals.py,line372,inlambda
 self._caller=lambdaf:f()
   File/home/www-data/web2py/applications/miramar_contact/controllers/default.py  
https://67.213.70.251/admin/default/edit/miramar_contact/controllers/default.py,line41,inindex
 TR(T('Enter what you 
see:'),Recaptcha(public_key='6LcRI-8SAAwNGmVIDpB_E45iurpVd7Mh5H2g',private_key='6LcRI-8SAHJon4JWF6nAErt_B4kEy-lXBxH5',use_ssl=True,error_message='invalid',label='Verify:',options='')),
   File/home/www-data/web2py/gluon/tools.py,line757,in__init__
 self.remote_addr=request.env.remote_addr
AttributeError:'NoneType'object has no attribute'env'

I followed the instructions to the letter. I inserted the following in 
my form:


Recaptcha(public_key='my public key',private_key='my private 
key',use_ssl=True,error_message='invalid',label='Verify:',options='')


I don't know what I'm missing. Is the web2py book missing something, 
too? Methinks it is.


Thanks.
--
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.

For more options, visit https://groups.google.com/groups/opt_out.


--
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.
For more options, visit https://groups.google.com/groups/opt_out.