{% extends form.base_template|default:"base.html" %}
{% load chunks %}
+{% load honeypot %}
{% block title %}{{ form.form_title }}{% endblock %}
<form method="POST" action="." enctype="multipart/form-data" class="submit-form">
{% csrf_token %}
+ {% render_honeypot_field %}
<table>
{{ form.as_table }}
<tr><td></td><td><button>{% block contact_form_submit %}{{ form.submit_label }}{% endblock %}</button></td></tr>
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from fnpdjango.utils.views import serve_file
+from honeypot.decorators import check_honeypot
+
from .forms import contact_forms
from .models import Attachment
+@check_honeypot
def form(request, form_tag, force_enabled=False):
try:
form_class = contact_forms[form_tag]
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
- 'honeypot.middleware.HoneypotMiddleware',
('django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth'),
('django_cas.middleware.CASMiddleware', 'django_cas'),
('django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages'),