Skip to main content

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

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:

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 to INSTALLED_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

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

aldryn-forms-recaptcha-plugin-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page