The contact module is designed to be a DRY style contact form.


  • Add '' to your INSTALLED_APPS
  • Run ./ migrate to create the necessary database tables
  • Create the required templates (see templates and views below)
  • Add urls to your url conf


The contact module has the following settings values which which may be used to customize its behavior

Iterable of email addresses. Each person in this list will be emailed for each contact form recipient. If not present, the contact module will use the values present in the Recipients table. (See the Recipients section)
Overide default verbose_name and verbose_name_plural meta settings on the Submission model.
Overide default verbose_name and verbose_name_plural meta settings on the Recipient model.


The contact application provides the following models.

class*args, **kwargs)

Recipient(id, name, email, is_active)

class*args, **kwargs)

Submission(id, name, email, comment)


The contact module provides the following class-based views located in


You may include the urls for the contact module one of two ways.

  1. Include the built in url conf somewhere in your site url conf:

    url(r'^contact-us/', include('')),
  2. Manually include the urls for both the index and success views. Often this is the best way to customize the contact form or add extra context variables. The example below is equivilant to the include statement:

    (r'^contact-us/$', '', name='contact_index'),
    (r'^contact-us/success/$', '', name='contact_success'),


The contact module requires you to create two templates.

Primary Contact Form Template

Default Location: contact/index.html

This template is rendered with the context variable form.


<form method-"post">
    {% csrf_token %}
    {{ form }}
    {% uncaptcha %}
    <button type="submit">Submit</button>

Success Page Template

Default Location: contact/success.html


<p>Thank you for contacting Us.  Someone will be in touch with you shortly!</p>

Email Template

Default Location: mail/contact_form_submission.html

Successful contact form submissions will be emailed using the fusionbox send_markdown_email function to a list of recipients. The contact module will first look for CONTACT_FORM_RECIPIENTS in the settings file, and if not will use the values from the Recipients table.

Default Template:

subject: Someone has filled out the contact form

Someone has submitted the contact form.

- *Name:* {{ }}
- *Email:* {{ }}
- *Comment:* {{ submission.comment }}

Use the following link to view this submission.

[{{ host }}{{ submission.get_absolute_url }}]({{ host }}{{ submission.get_absolute_url }})


The contact app automatically registers the following admin classes for its models.

class, admin_site)

Defauld admin class for Only registered if no hard-coded list of recipients is found in settings.CONTACT_FORM_RECIPIENTS.

class, admin_site)

Default admin class for Allows for bulk csv export of Submission entries, and restricts readonly access.

class Media

Ensures that whitespace linebreaks are respected when displaying the Submission.comment field.

SubmissionAdmin.get_readonly_fields(request, obj=None)

Dynamically build a list of field names for the model. This allows for monkeypatches to the Submission model to not require a new admin class.

SubmissionAdmin.has_add_permission(*args, **kwargs)

Submissions should not be creatable from the admin center.


Allows for display of a truncated version of Submission.comment in the list_display.


The contact module has two methods for designating recipients to be emailed with the details from contact form submissions. If the CONTACT_FORM_RECIPIENTS value is present in the settings file, those recipeints will be used.

If the setting is not present, the Recipients model will be registered for the admin site, and the values there will be used.