def validate_recaptcha(response, remote_ip=None):
 if (not response):
  return False
 payload = {'secret': settings.RECAPTCHA_SECRET_KEY, 'response': response}
 if remote_ip:
  payload.update({'remoteip': remote_ip})
 resp = requests.post(settings.RECAPTCHA_VERIFY_URL, data=payload)
 return ((resp.status_code == httplib.OK) and resp.json().get('success'))

def validate_recaptcha ( response , remote_ip = None ) : if ( not response ) : return False payload = { 'secret' : settings . RECAPTCHA_SECRET_KEY , 'response' : response } if remote_ip : payload . update ( { 'remoteip' : remote_ip } ) resp = requests . post ( settings . RECAPTCHA_VERIFY_URL , data = payload ) return ( ( resp . status_code == httplib . OK ) and resp . json ( ) . get ( 'success' ) )
validate if the recaptcha response is valid .