{"id":23576,"library":"django-honeypot","title":"django-honeypot","description":"A Django application that provides honeypot field utilities for protecting forms against spam bots without requiring CAPTCHAs. Current version 1.3.0 supports Python >=3.12 and Django 4.x/5.x. Released irregularly.","status":"active","version":"1.3.0","language":"python","source_language":"en","source_url":"https://github.com/jamesturk/django-honeypot","tags":["django","spam","honeypot","forms"],"install":[{"cmd":"pip install django-honeypot","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"django-honeypot requires Django","package":"django","optional":false}],"imports":[{"note":"","wrong":"","symbol":"HoneypotField","correct":"from honeypot.fields import HoneypotField"},{"note":"","wrong":"","symbol":"honeypot_equals","correct":"from honeypot.decorators import honeypot_equals"},{"note":"","wrong":"","symbol":"verify_honeypot_value","correct":"from honeypot.decorators import verify_honeypot_value"}],"quickstart":{"code":"# In settings.py\nINSTALLED_APPS = [\n    ...\n    'honeypot',\n]\n\n# In a form\nfrom honeypot.fields import HoneypotField\nclass MyForm(forms.Form):\n    name = forms.CharField()\n    email = forms.EmailField()\n    hp = HoneypotField()\n\n# In a view with decorator\nfrom honeypot.decorators import verify_honeypot_value\nfrom django.shortcuts import render\n\n@verify_honeypot_value(field_name='hp')\ndef my_view(request):\n    # process form\n    return render(request, 'form.html', {'form': MyForm()})\n\n# In template, render honeypot field\n{{ form.hp }}","lang":"python","description":"Minimal integration: add honeypot to INSTALLED_APPS, include HoneypotField in forms, and use verify_honeypot_value decorator on views."},"warnings":[{"fix":"Ensure the template includes the honeypot field (e.g., {{ form.hp }}) and does not include it more than once.","message":"HoneypotField must be rendered in the template exactly once per form. If omitted or rendered multiple times, the decorator may still pass silently unless the field name is missing.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the decorator only on views that handle POST requests or add method checking in the view logic.","message":"The decorator verify_honeypot_value does not check for honeypot presence if the request method is not POST. It only validates on POST requests.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace honeypot_equals with verify_honeypot_value decorator.","message":"The 'honeypot_equals' decorator is deprecated in favor of 'verify_honeypot_value' with more flexible configuration.","severity":"deprecated","affected_versions":">=1.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from honeypot.fields import HoneypotField","cause":"Importing directly from 'honeypot' instead of 'honeypot.fields'.","error":"AttributeError: module 'honeypot' has no attribute 'HoneypotField'"},{"fix":"Add HONEYPOT_FIELD_NAME = 'hp' to settings.py or pass field_name='hp' to the decorator.","cause":"Missing HONEYPOT_FIELD_NAME in settings when using 'verify_honeypot_value' without specifying field_name argument.","error":"django.core.exceptions.ImproperlyConfigured: The HONEYPOT_FIELD_NAME setting must be set."},{"fix":"Upgrade to django-honeypot >=1.3.0 or use the deprecated honeypot_equals.","cause":"Using old version (<1.3.0) where the decorator did not accept field_name parameter.","error":"TypeError: verify_honeypot_value() got an unexpected keyword argument 'field_name'","affected_versions":"<1.3.0"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}