Skip to main content

Add-on djangocms-form-builder to add an invisible honeypot anti-spam field

Project description

djangocms_form_builder_honeypot

Greffon pour djangocms-form-builder qui ajoute automatiquement un champ leurre invisible aux formulaires CMS pour filtrer les soumissions de bots.

Fonctionnalités

  • Injection automatique : un champ texte masqué est ajouté à chaque formulaire CMS via un processeur CMS (sans surcharger les templates Bootstrap du form-builder)
  • Rendu identique aux autres champs (form-floating, form-control, etc.)
  • Rejet silencieux : par défaut, les bots voient un succès mais aucune action (email, Brevo, sauvegarde BDD) n'est exécutée
  • Configuration par formulaire dans l'admin CMS (section « Anti-spam » du plugin Form)
  • Valeurs par défaut configurables globalement via les settings Django

Requirements

  • Python 3.10+
  • Django 3.2+
  • djangocms-form-builder ^0.5
  • django-cms

Installation

pip install djangocms_form_builder_honeypot

Configuration

  1. Ajoutez djangocms_form_builder_honeypot à INSTALLED_APPS (après djangocms_form_builder) :
INSTALLED_APPS = [
    # ...
    "djangocms_form_builder",
    "djangocms_form_builder_honeypot",
    # ...
]

Le module enregistre automatiquement un CMS_PLUGIN_PROCESSOR pour injecter le champ dans le HTML rendu du plugin Form.

  1. Valeurs par défaut dans settings.py (utilisées à la création d'un nouveau formulaire CMS) :
DJANGOCMS_FORM_BUILDER_HONEYPOT_ENABLED = True
DJANGOCMS_FORM_BUILDER_HONEYPOT_FIELD_NAME = "site_web"
DJANGOCMS_FORM_BUILDER_HONEYPOT_LABEL = "Site web"
DJANGOCMS_FORM_BUILDER_HONEYPOT_SILENT_REJECT = True
DJANGOCMS_FORM_BUILDER_HONEYPOT_SUCCESS_MESSAGE = "<p>Merci pour votre message.</p>"
  1. Dans l'admin CMS, ouvrez un plugin Form : la section Anti-spam permet de configurer pour chaque formulaire :
    • Activer / désactiver le champ leurre
    • Nom et libellé du champ
    • Rejet silencieux

Fonctionnement

Le champ est rendu comme un champ texte classique du form-builder, puis masqué hors écran. Les utilisateurs humains ne le voient pas ; les bots le remplissent souvent. Si le champ contient une valeur à la soumission, la requête est ignorée côté serveur.

Le module complète les protections existantes (Altcha, login requis, etc.) sans interaction utilisateur supplémentaire.

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

djangocms_form_builder_honeypot-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file djangocms_form_builder_honeypot-0.0.2.tar.gz.

File metadata

File hashes

Hashes for djangocms_form_builder_honeypot-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8fe654e65e4f76dcd683973a78d29a0b00b9e16c24f079ee8d790ad637ce1146
MD5 48b2b8162b3bcd94f190e084b72f359f
BLAKE2b-256 daea6873edaea2515ed38641761f217ade46b29619a897b4cadc24c1692ca4e4

See more details on using hashes here.

File details

Details for the file djangocms_form_builder_honeypot-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_form_builder_honeypot-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f10c4b32ffad52485e2e71a3fd175b75015251aaae64a9d3a62ee8170b266db
MD5 68bf4c953d4ab307deb050296fc992be
BLAKE2b-256 a09aa6c7a74311d248daf48a03d2cc48b8da31aaa30f1ecc5eb0403beeba797a

See more details on using hashes here.

Supported by

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