$ git clone git@github.com:jbergantine/django-contact-form.git
$ cd django-contact-form
$ python setup.py install
You will also have to install Django Floppyforms.
Include in the PIP requirements file the following lines:
django-floppyforms
-e git://github.com/jbergantine/django-contact-form.git#egg=django_contact_form
And then install as normal (IE:)
$ pip install -r path/to/requirements/file.txt
Add to the project's settings.py file tuple of installed apps: :
'floppyforms',
'django_contact_form',
In the project's urls.py file add: :
url(r'^contact/', include('django_contact_form.urls')),
Form submissions will go to either a list of recipients defined in a custom tuple called CONTACT_FORM_RECIPIENTS or, if that can't be found in the settings file, the list of MANAGERS. The format for CONTACT_FORM_RECIPIENTS should follow the format for MANAGERS and should look something like: :
CONTACT_FORM_RECIPIENTS = (
('Barack Obama', 'barack@whitehouse.gov'),
)
In the project's settings.py file configure the following: :
EMAIL_HOST = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
DEFAULT_FROM_EMAIL = ''
By default the templates contain only the bare necessities. To override the default templates, create a directory called contact in your templates directory and add 2 files: contact_form.html and thanks.html. If you're using virtualenv, to copy the templates from the project in order to make adjustments to them, cd to the root of the django project and execute the following command: :
cp -r $VIRTUAL_ENV/src/django-contact-form/django_contact_form/templates/contact templates/contact