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
- Set this parameter:
GOOGLE_RECAPTCHA_LANGUAGE = "en"
Link:
License
This project is licensed under the MIT License (see the LICENSE file for details).
Metadata
Release files for EasyFlaskRecaptcha 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| EasyFlaskRecaptcha-1.0.2.tar.gz | 3.6 kB | Without provenance | Details for EasyFlaskRecaptcha-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| EasyFlaskRecaptcha-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for EasyFlaskRecaptcha-1.0.2-py3-none-any.whl |
Total release size: 7.6 kB
Release files / EasyFlaskRecaptcha-1.0.2.tar.gz
| Download URL | EasyFlaskRecaptcha-1.0.2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d166a70b4b1a2cf4a251e8f3e5889cbc22e91d065e5fb7236cb500c51dda7afd
|
|
BLAKE2b-256 checksum How to use checksums |
7abb44d7f4f9d9cb81fec8d33c4a40833ac1eb2fdb7af4dcb32adcc37d06b48a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / EasyFlaskRecaptcha-1.0.2-py3-none-any.whl
| Download URL | EasyFlaskRecaptcha-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
84641517e84d6d0e933b7d13cd8aa7e3c00aaa074e0ed6b67e0a608250f6915d
|
|
BLAKE2b-256 checksum How to use checksums |
4354d8b231460199119c5cb39ea08646bcd21b506195f00341cfec51c186f66e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for EasyFlaskRecaptcha 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.