{ "info": { "author": "Steib Cristian", "author_email": "cristiansteib@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Framework :: Flask", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Security" ], "description": "# crecaptcha\n###### A simple python module for Google Recaptcha V3\nA pure python module, don't requires requests library\n## Installation\n- from latest version on PyPi:\n ```bash\n pip install crecaptcha\n ```\n \n## how to use?\n```python\nfrom crecatpcha.crecaptcha import crecaptcha\nSECRET_KEY = 'Your secret key'\n\ndef some_function():\n response_token = 'the response token from the client'\n \n if crecaptcha(SECRET_KEY, response_token, 'action_name'):\n # safe action\n pass\n else:\n # is a bot, take your custom action.\n pass\n ```\n \n \n## how to use with django?\n### Configuration:\nIn the settings.py define the following values: \n **CRECAPTCHA_SECRET_KEY**: the recaptcha secret key. \n **CRECAPTCHA_KEY_NAME**: the name of the var in the POST request, by default is 'recaptcha_token'. \n Example:\n ```python\nCRECAPTCHA_SECRET_KEY = \"jgjdnvurmfj3nrfo3nrlksjf\" # Mandatory\nCRECAPTCHA_KEY_NAME = \"grecatpcha\" # by default is 'recaptcha_token'\n ```\n \n### Usage:\n#### Simple way:\nIn the following example if the recaptcha validation fails, it will raise an HttpResponseForbidden\n```python\nfrom crecatpcha.django_crecatpcha import crecaptcha\n\n@crecaptcha('login')\ndef login_user(request):\n pass\n \n@crecaptcha('register', threshold=0.6)\ndef register_user(request):\n pass\n \n```\n\n#### Advance way:\nYou can define your custom callback when the validations fails, an optionally you can send args & kwargs.\n\n```python\nfrom crecatpcha.django_crecatpcha import crecaptcha\n\ndef register_user_on_crecaptcha_error(request, *args, **kwargs):\n pass\n \n@crecaptcha('register', register_user_on_crecaptcha_error, args_on_error=[], kwargs_on_error={}) \ndef register_user(request):\n pass\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cristiansteib/crecaptcha/", "keywords": "", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "crecaptcha", "package_url": "https://pypi.org/project/crecaptcha/", "platform": "", "project_url": "https://pypi.org/project/crecaptcha/", "project_urls": { "Homepage": "https://github.com/cristiansteib/crecaptcha/" }, "release_url": "https://pypi.org/project/crecaptcha/0.1.32/", "requires_dist": null, "requires_python": "", "summary": "reCatpcha api v3.0 - with django support", "version": "0.1.32" }, "last_serial": 4384494, "releases": { "0.1.31": [ { "comment_text": "", "digests": { "md5": "1fef81c550748339cc45c94a60497891", "sha256": "94ae70fae0241159ab130bd1d53b4060a558583affd2c7e68cd4db8bcee098e2" }, "downloads": -1, "filename": "crecaptcha-0.1.31.tar.gz", "has_sig": false, "md5_digest": "1fef81c550748339cc45c94a60497891", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7086, "upload_time": "2018-10-16T23:46:51", "url": "https://files.pythonhosted.org/packages/3a/0e/cb97d5694adc9c7cf0d0b60dc175990b09ae1cf0b3035f488437b7eb975f/crecaptcha-0.1.31.tar.gz" } ], "0.1.32": [ { "comment_text": "", "digests": { "md5": "e13648d639bb5a5f525cea3cfb877000", "sha256": "832f84305c26ca2f370f85a0f3a6513a794240a113697a870e08428508d0641d" }, "downloads": -1, "filename": "crecaptcha-0.1.32.tar.gz", "has_sig": false, "md5_digest": "e13648d639bb5a5f525cea3cfb877000", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7120, "upload_time": "2018-10-17T00:18:54", "url": "https://files.pythonhosted.org/packages/db/d8/4b975cc0b846b5b5ad504539cbb534ef5ee3c161db949a625a8773e5f789/crecaptcha-0.1.32.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e13648d639bb5a5f525cea3cfb877000", "sha256": "832f84305c26ca2f370f85a0f3a6513a794240a113697a870e08428508d0641d" }, "downloads": -1, "filename": "crecaptcha-0.1.32.tar.gz", "has_sig": false, "md5_digest": "e13648d639bb5a5f525cea3cfb877000", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7120, "upload_time": "2018-10-17T00:18:54", "url": "https://files.pythonhosted.org/packages/db/d8/4b975cc0b846b5b5ad504539cbb534ef5ee3c161db949a625a8773e5f789/crecaptcha-0.1.32.tar.gz" } ] }