This package provides a simple invisible recaptcha v3 implementation
Project description
Aldryn Forms Recaptcha Plugin
This python module is open-source, available here: https://gitlab.com/what-digital/aldryn-forms-recaptcha-plugin/
Versioning and Packages
-
versioning is done in versioning in
aldryn_forms_recaptcha_plugin/__init__.py
-
for each version a tag is added to the gitlab repository in the form of
^(\d+\.)?(\d+\.)?(\*|\d+)$
, example: 0.0.10 -
There is a PyPI version which relies on the gitlab tags (the download_url relies on correct gitlab tags being set): https://pypi.org/project/aldryn-forms-recaptcha-plugin/
-
There is a DjangoCMS / Divio Marketplace add-on which also relies on the gitlab tags: https://marketplace.django-cms.org/en/addons/browse/aldryn-forms-recaptcha-plugin/
In order to release a new version of the Divio add-on:
- Increment version number in
addons-dev/aldryn-forms-recaptcha-plugin/aldryn_forms_recaptcha_plugin/__init__.py
- divio addon validate
- divio addon upload
- Then git add, commit and tag with the version number and push to the repo
git add .
git commit -m "<message>"
git tag 0.0.XX
git push origin 0.0.19
Then, in order to release a new pypi version:
- python3 setup.py sdist bdist_wheel
- twine upload --repository-url https://test.pypi.org/legacy/ dist/*
- twine upload dist/*
Development
- Run
pip install -e ../aldryn-forms-recaptcha-plugin/
in your demo project - You can open aldryn_forms_recaptcha_plugin in pycharm and set the python interpreter of the demo project to get proper django support and code completion.
Dependencies
- aldryn_forms
Setup
- install the add-on on divio.com or via pypi
pip install aldryn-forms-recaptcha-plugin
- add
aldryn-forms-recaptcha-plugin
to your requirements.txt or requirements.in - add
aldryn_forms_recaptcha_plugin
toINSTALLED_APPS
- possibly, you want to copy the captcha widget from templates/ and adapt it according to the styling of error messages in your form. The example in this package is compatible with bootstrap4 and works well with https://gitlab.com/what-digital/djangocms-aldryn-forms-bootstrap4-templates
settings.py configuration
Configure the following settings in your settings.py
:
INSTALLED_APPS += (
# for the ReCaptchaField
'aldryn_forms_recaptcha_plugin', # needs to be before 'captcha' for template overriding
'captcha', # django-recaptcha
)
RECAPTCHA_PUBLIC_KEY = env('ALDRYN_FORMS_RECAPTCHA_SITE_KEY', '123')
RECAPTCHA_PRIVATE_KEY = env('ALDRYN_FORMS_RECAPTCHA_SECRET', '123')
# set this to 0 (or 1) to deactivate (or always activate) the captcha protection
RECAPTCHA_REQUIRED_SCORE = 0.85
TODOs
- For this to work https://github.com/divio/aldryn-forms/issues/146 needs to be resolved by the maintainers of aldryn-forms
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aldryn-forms-recaptcha-plugin-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59aa73fe23f4b177db694cf384ad0a985c017fcdd35705573285813e1208f8e5 |
|
MD5 | a2a131583e9fcbbb3193cdf094651d31 |
|
BLAKE2b-256 | d79bd3078106eeca758f742aa5b54b17f878d1f9a0e236c65136d5fbe85d84e7 |
Hashes for aldryn_forms_recaptcha_plugin-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e0bcb589fa49023659ad00f7afc5d96520f55e22e27719cd06c0e6ebb305c87 |
|
MD5 | d6f89f25ec7c5ba54fbee53f1f61abbe |
|
BLAKE2b-256 | 549159b174ba6e83aaa6f3082b7cc0933ab50cbd33973c95b71b8dde86f44a97 |