EasyFlaskRecaptcha


NameEasyFlaskRecaptcha JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/pushpenderindia/EasyFlaskRecaptcha
SummaryEasy Integration of Google Recaptcha in Flask
upload_time2024-03-12 10:14:08
maintainer
docs_urlNone
authorPushpender Singh
requires_python
licenseMIT License
keywords flaskrecaptcha flask recaptcha google python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # EasyFlaskRecaptcha
EasyFlaskRecaptcha is a python Module which makes Google Recaptcha Integration in flask application easy

## Installation

```
pip install EasyFlaskRecaptcha
```

### Implementation
```
from flask import Flask
from EasyFlaskRecaptcha import ReCaptcha

app = Flask(__name__)
recaptcha = ReCaptcha(app)

app.config.update(dict(
    GOOGLE_RECAPTCHA_ENABLED=True,
    GOOGLE_RECAPTCHA_SITE_KEY="6Lf74pUpXXXXXXXXXXXXXXXi012KXXXX7KB-31XXXH",
    GOOGLE_RECAPTCHA_SECRET_KEY="6LXXXXXXXXXXAFX-ZAXXXXXGSd-y5g0o-JZXXXXB"
))
recaptcha.init_app(app)
```
    
## Flask Template Usage Example (Frontend)
```
Description: Use {{ recaptcha }} Tag inside form tag
```

```
<form method="post" action="/submit">
    ...
    {{ recaptcha }}

    [submit]
</form>
```

## Flask Backend Route Example
```
@route("/submit", methods=["POST"])
def submit():
    if recaptcha.verify():
        print("SUCCESS") 
            
    else:
        print("FAILED")
```

## Default Settings
```
GOOGLE_RECAPTCHA_ENABLED = True
GOOGLE_RECAPTCHA_THEME = "light"
GOOGLE_RECAPTCHA_TYPE = "image"
GOOGLE_RECAPTCHA_SIZE = "normal"
GOOGLE_RECAPTCHA_LANGUAGE = "en"
GOOGLE_RECAPTCHA_TABINDEX = 0
```

## More Settings

```
GOOGLE_RECAPTCHA_ENABLED = True
GOOGLE_RECAPTCHA_SITE_KEY = ""
GOOGLE_RECAPTCHA_SECRET_KEY = ""
GOOGLE_RECAPTCHA_THEME = "light"
GOOGLE_RECAPTCHA_TYPE = "image"
GOOGLE_RECAPTCHA_SIZE = "normal"
GOOGLE_RECAPTCHA_LANGUAGE = "en"
GOOGLE_RECAPTCHA_TABINDEX = 10
```

Apply these settings like this:
```
from flask import Flask
from EasyFlaskRecaptcha import ReCaptcha

app = Flask(__name__)
recaptcha = ReCaptcha(app)

app.config.update(dict(
    GOOGLE_RECAPTCHA_ENABLED=True,
    GOOGLE_RECAPTCHA_SITE_KEY="6Lf74pUpXXXXXXXXXXXXXXXi012KXXXX7KB-31XXXH",
    GOOGLE_RECAPTCHA_SECRET_KEY="6LXXXXXXXXXXAFX-ZAXXXXXGSd-y5g0o-JZXXXXB",
    GOOGLE_RECAPTCHA_THEME = "light",
    GOOGLE_RECAPTCHA_TYPE = "image",
    GOOGLE_RECAPTCHA_SIZE = "normal",
    GOOGLE_RECAPTCHA_LANGUAGE = "en",
    GOOGLE_RECAPTCHA_RTABINDEX = 10,
))
recaptcha.init_app(app)
```

- Figure out your desired language code (such as for english, language code is en) from this link: [Google Recaptcha Language Codes](https://developers.google.com/recaptcha/docs/language)
- Set this parameter: `GOOGLE_RECAPTCHA_LANGUAGE = "en"`

## Link:

* [Google Recaptcha Language Codes](https://developers.google.com/recaptcha/docs/language)
* [Documentation](https://github.com/PushpenderIndia/EasyFlaskRecaptcha)
* [PyPI](https://pypi.org/project/EasyFlaskRecaptcha/)

## License

This project is licensed under the MIT License (see the `LICENSE` file for details).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pushpenderindia/EasyFlaskRecaptcha",
    "name": "EasyFlaskRecaptcha",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "flaskrecaptcha,flask,recaptcha,google,python",
    "author": "Pushpender Singh",
    "author_email": "pushpendersingh@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7a/bb/44d7f4f9d9cb81fec8d33c4a40833ac1eb2fdb7af4dcb32adcc37d06b48a/EasyFlaskRecaptcha-1.0.2.tar.gz",
    "platform": null,
    "description": "# EasyFlaskRecaptcha\nEasyFlaskRecaptcha is a python Module which makes Google Recaptcha Integration in flask application easy\n\n## Installation\n\n```\npip install EasyFlaskRecaptcha\n```\n\n### Implementation\n```\nfrom flask import Flask\nfrom EasyFlaskRecaptcha import ReCaptcha\n\napp = Flask(__name__)\nrecaptcha = ReCaptcha(app)\n\napp.config.update(dict(\n    GOOGLE_RECAPTCHA_ENABLED=True,\n    GOOGLE_RECAPTCHA_SITE_KEY=\"6Lf74pUpXXXXXXXXXXXXXXXi012KXXXX7KB-31XXXH\",\n    GOOGLE_RECAPTCHA_SECRET_KEY=\"6LXXXXXXXXXXAFX-ZAXXXXXGSd-y5g0o-JZXXXXB\"\n))\nrecaptcha.init_app(app)\n```\n    \n## Flask Template Usage Example (Frontend)\n```\nDescription: Use {{ recaptcha }} Tag inside form tag\n```\n\n```\n<form method=\"post\" action=\"/submit\">\n    ...\n    {{ recaptcha }}\n\n    [submit]\n</form>\n```\n\n## Flask Backend Route Example\n```\n@route(\"/submit\", methods=[\"POST\"])\ndef submit():\n    if recaptcha.verify():\n        print(\"SUCCESS\") \n            \n    else:\n        print(\"FAILED\")\n```\n\n## Default Settings\n```\nGOOGLE_RECAPTCHA_ENABLED = True\nGOOGLE_RECAPTCHA_THEME = \"light\"\nGOOGLE_RECAPTCHA_TYPE = \"image\"\nGOOGLE_RECAPTCHA_SIZE = \"normal\"\nGOOGLE_RECAPTCHA_LANGUAGE = \"en\"\nGOOGLE_RECAPTCHA_TABINDEX = 0\n```\n\n## More Settings\n\n```\nGOOGLE_RECAPTCHA_ENABLED = True\nGOOGLE_RECAPTCHA_SITE_KEY = \"\"\nGOOGLE_RECAPTCHA_SECRET_KEY = \"\"\nGOOGLE_RECAPTCHA_THEME = \"light\"\nGOOGLE_RECAPTCHA_TYPE = \"image\"\nGOOGLE_RECAPTCHA_SIZE = \"normal\"\nGOOGLE_RECAPTCHA_LANGUAGE = \"en\"\nGOOGLE_RECAPTCHA_TABINDEX = 10\n```\n\nApply these settings like this:\n```\nfrom flask import Flask\nfrom EasyFlaskRecaptcha import ReCaptcha\n\napp = Flask(__name__)\nrecaptcha = ReCaptcha(app)\n\napp.config.update(dict(\n    GOOGLE_RECAPTCHA_ENABLED=True,\n    GOOGLE_RECAPTCHA_SITE_KEY=\"6Lf74pUpXXXXXXXXXXXXXXXi012KXXXX7KB-31XXXH\",\n    GOOGLE_RECAPTCHA_SECRET_KEY=\"6LXXXXXXXXXXAFX-ZAXXXXXGSd-y5g0o-JZXXXXB\",\n    GOOGLE_RECAPTCHA_THEME = \"light\",\n    GOOGLE_RECAPTCHA_TYPE = \"image\",\n    GOOGLE_RECAPTCHA_SIZE = \"normal\",\n    GOOGLE_RECAPTCHA_LANGUAGE = \"en\",\n    GOOGLE_RECAPTCHA_RTABINDEX = 10,\n))\nrecaptcha.init_app(app)\n```\n\n- Figure out your desired language code (such as for english, language code is en) from this link: [Google Recaptcha Language Codes](https://developers.google.com/recaptcha/docs/language)\n- Set this parameter: `GOOGLE_RECAPTCHA_LANGUAGE = \"en\"`\n\n## Link:\n\n* [Google Recaptcha Language Codes](https://developers.google.com/recaptcha/docs/language)\n* [Documentation](https://github.com/PushpenderIndia/EasyFlaskRecaptcha)\n* [PyPI](https://pypi.org/project/EasyFlaskRecaptcha/)\n\n## License\n\nThis project is licensed under the MIT License (see the `LICENSE` file for details).\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Easy Integration of Google Recaptcha in Flask",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/pushpenderindia/EasyFlaskRecaptcha"
    },
    "split_keywords": [
        "flaskrecaptcha",
        "flask",
        "recaptcha",
        "google",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4354d8b231460199119c5cb39ea08646bcd21b506195f00341cfec51c186f66e",
                "md5": "5f8360a43cffd2284391f2e9182b14ee",
                "sha256": "84641517e84d6d0e933b7d13cd8aa7e3c00aaa074e0ed6b67e0a608250f6915d"
            },
            "downloads": -1,
            "filename": "EasyFlaskRecaptcha-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f8360a43cffd2284391f2e9182b14ee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4023,
            "upload_time": "2024-03-12T10:14:06",
            "upload_time_iso_8601": "2024-03-12T10:14:06.525534Z",
            "url": "https://files.pythonhosted.org/packages/43/54/d8b231460199119c5cb39ea08646bcd21b506195f00341cfec51c186f66e/EasyFlaskRecaptcha-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7abb44d7f4f9d9cb81fec8d33c4a40833ac1eb2fdb7af4dcb32adcc37d06b48a",
                "md5": "3c7bd7af9e30db9a7ce7e90bf5515709",
                "sha256": "d166a70b4b1a2cf4a251e8f3e5889cbc22e91d065e5fb7236cb500c51dda7afd"
            },
            "downloads": -1,
            "filename": "EasyFlaskRecaptcha-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3c7bd7af9e30db9a7ce7e90bf5515709",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3626,
            "upload_time": "2024-03-12T10:14:08",
            "upload_time_iso_8601": "2024-03-12T10:14:08.168188Z",
            "url": "https://files.pythonhosted.org/packages/7a/bb/44d7f4f9d9cb81fec8d33c4a40833ac1eb2fdb7af4dcb32adcc37d06b48a/EasyFlaskRecaptcha-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 10:14:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pushpenderindia",
    "github_project": "EasyFlaskRecaptcha",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "easyflaskrecaptcha"
}
        
Elapsed time: 0.23111s