Skip to content

Instantly share code, notes, and snippets.

@PraveshKoirala
PraveshKoirala / recaptcha_validate.py
Last active September 29, 2016 10:36 — forked from earthtrip/recaptcha_validate.py
Simple Recaptcha validation method when using Google App Engine (GAE), Webapp2 [Updated]
from google.appengine.api import urlfetch
from urllib import urlencode
import json
def validate_captcha(self):
recaptcha_response_field = self.request.params.get("g-recaptcha-response")
remote_ip = self.request.remote_addr
secret = 'YOUR SECRET HERE' # put recaptcha private key here
recaptcha_post_data = {