ValueError: unknown url type: www.google.com/recaptcha/api
Estoy usando la misma cuenta de captcha que en otra aplicación, el captcha si
se ve en el formulario, el error surge si lo envio.
Quedo a la escucha de ideas... gracias
al final va completo:
La conifguración que suo es la siguiente:
if ENTORNO=='web':
PUBLIC_KEY = 'algo'
PRIVATE_KEY = 'algo'
from gluon.tools import Recaptcha
Recaptcha.API_SSL_SERVER = 'https://www.google.com/recaptcha/api'
Recaptcha.API_SERVER = 'https://www.google.com/recaptcha/api'
Recaptcha.VERIFY_SERVER = 'www.google.com/recaptcha/api'
auth.settings.register_captcha = Recaptcha(request, PUBLIC_KEY, PRIVATE_KEY)
auth.settings.download_url = URL(request.application,'default','download')
Lo tengo tal cual en otra aplicación que si funciona, pero en un web2py anterior.
El error completo:
Traceback (most recent call last):
File "/home/nicolas/web2py_nuevo/gluon/restricted.py", line 204, in restricted
exec ccode in environment
File "/home/nicolas/web2py_nuevo/applications/desdeelfondo/controllers/default.py", line 93, in <module>
File "/home/nicolas/web2py_nuevo/gluon/globals.py", line 172, in <lambda>
self._caller = lambda f: f()
File "/home/nicolas/web2py_nuevo/applications/desdeelfondo/controllers/default.py", line 36, in user
return dict(form=auth())
File "/home/nicolas/web2py_nuevo/gluon/tools.py", line 1141, in __call__
return getattr(self,args[0])()
File "/home/nicolas/web2py_nuevo/gluon/tools.py", line 1898, in register
onvalidation=onvalidation,hideerror=self.settings.hideerror):
File "/home/nicolas/web2py_nuevo/gluon/sqlhtml.py", line 1082, in accepts
hideerror=hideerror,
File "/home/nicolas/web2py_nuevo/gluon/html.py", line 1798, in accepts
status = self._traverse(status,hideerror)
File "/home/nicolas/web2py_nuevo/gluon/html.py", line 743, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/nicolas/web2py_nuevo/gluon/html.py", line 743, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/nicolas/web2py_nuevo/gluon/html.py", line 743, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/nicolas/web2py_nuevo/gluon/html.py", line 743, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/nicolas/web2py_nuevo/gluon/html.py", line 750, in _traverse
newstatus = self._validate()
File "/home/nicolas/web2py_nuevo/gluon/tools.py", line 674, in _validate
httpresp = urllib2.urlopen(request)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 383, in open
protocol = req.get_type()
File "/usr/lib/python2.7/urllib2.py", line 245, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: www.google.com/recaptcha/api
Recaptcha.VERIFY_SERVER = 'https://www.google.com/recaptcha/api'
from gluon.tools import Recaptcha |
reCAPTCHA may not work if you access the web site as 'localhost' or '127.0.0.1', because it is registered to work with publicly visible web sites only.
No se puede usar accediendo como localhost . Si queres que use ssl la funcion tiene un parametro ssl=(True/False)
Recaptcha(..., use_ssl=True, error_message='invalid', label='Verify:', options='')