utils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Plamber 作者: OlegKlimenko 项目源码 文件源码
def validate_captcha(captcha_post):
    """
    Validates the Google re-captcha data.

    :param str captcha_post: The re-captcha post data
    :return bool:
    """
    validated = False

    data = {
        'secret': settings.GOOGLE_RECAPTCHA_SECRET_KEY,
        'response': captcha_post
    }

    response = requests.post('https://www.google.com/recaptcha/api/siteverify', data=data, verify=False).json()
    if response['success']:
        validated = True

    return validated
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号