django-contactme documentation¶
django-contactme provides a simple contact form that only hits the database when the user has visited the confirmation URL. Emails are threaded to avoid response blocking. It comes with a complete unittest set for both the backend functionality and the Jquery plugin.
Version 1.3 is compatible with:
- Django 1.9 under Python 2.7, 3.4, 3.5
- Django 1.8 under Python 2.7, 3.4, 3.5
Version 1.2 is compatible with:
- Django 1.8 under Python 2.7, 3.4
- Django 1.7 under Python 2.7, 3.4
- Django 1.6 under Python 2.7, 3.4
- Django 1.5 under Python 2.7, 3.4
- Django 1.4 under PYthon 2.7
Table of contents:
Quick start¶
- Add
django_contactme
toINSTALLED_APPS
. - Add
url(r'^contact/', include('django_contactme.urls'))
to your root URLconf. - Run the
migrate
command to apply migrations. - Run the
runserver
command and check the new contact form at http://localhost:8000/contact/
Workflow in short¶
The user...
- Clicks on the contact me/us link of your site.
- Fills in the contact form data with her
name
,email address
andmessage
, and clicks on preview. - She finally clicks on post and submit the form.
- Then django-contactme:
- Creates a token with the contact form data.
- Sends an email to the user with a confirmation URL containing the token.
- And shows a template informing the user that she must click on the link to confirm the message.
- The user receives the email, opens it, and clicks on the confirmation link.
- Then django-contactme:
- Verifies the token and creates a
ContactMsg
model instance.- Sends an email to the addresses listed in CONTACTME_NOTIFY_TO, to notify that a new contact message has reached the database.
- And finally shows a template being grateful for the message.
Read a longer workflow description in the Workflow section of the Tutorial.