2 Generic app for creating contact forms.
4 0. Add 'contact' to your INSTALLED_APPS and include 'contact.urls' somewhere
7 include('contact.urls'))
11 2. Create somewhere in your project a module with some subclasses of
12 contact.forms.ContactForm, specyfing form_tag and some fields in each.
14 3. Set CONTACT_FORMS_MODULE in your settings to point to the module.
16 4. Link to the form with {% url 'contact_form' form_tag %}.
18 5. Optionally override some templates in form-specific template directories
19 (/contact/<form_tag>/...).
21 6. Receive submitted forms by email and read them in admin.
28 CONTACT_FORMS_MODULE = 'myproject.contact_forms'
30 myproject/contact_forms.py:
31 from django import forms
32 from contact.forms import ContactForm
33 from django.utils.translation import ugettext_lazy as _
35 class RegistrationForm(ContactForm):
37 name = forms.CharField(label=_('Name'), max_length=128)
38 presentation = forms.FileField(label=_('Presentation'))
41 {% url 'contact:form' 'register' %}
45 from fnpdjango.utils.app import AppSettings
48 class Settings(AppSettings):
49 FORMS_MODULE = "contact_forms"
52 app_settings = Settings('CONTACT')