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,in<module>
File"/home/www-data/web2py/gluon/globals.py",line372,in<lambda>
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-8SAAAAAAwNGmVIDpB_E45iurpVd7Mh5H2g',private_key='6LcRI-8SAAAAAHJon4JWF6nAErt_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 [email protected].
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.