X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/98b2c09ef1f1c8288a31517f61423264c6b3291c..e2a460b0a960df9482701ab10ec135a5cc3c69ac:/src/contact/__init__.py?ds=inline diff --git a/src/contact/__init__.py b/src/contact/__init__.py index 3bce2e392..e69de29bb 100644 --- a/src/contact/__init__.py +++ b/src/contact/__init__.py @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Generic app for creating contact forms. - -0. Add 'contact' to your INSTALLED_APPS and include 'contact.urls' somewhere -in your urls.py, like: - url(r'^contact/', - include('contact.urls')) - -1. Migrate. - -2. Create somewhere in your project a module with some subclasses of -contact.forms.ContactForm, specyfing form_tag and some fields in each. - -3. Set CONTACT_FORMS_MODULE in your settings to point to the module. - -4. Link to the form with {% url 'contact_form' form_tag %}. - -5. Optionally override some templates in form-specific template directories -(/contact//...). - -6. Receive submitted forms by email and read them in admin. - - -Example: -======== - -settings.py: - CONTACT_FORMS_MODULE = 'myproject.contact_forms' - -myproject/contact_forms.py: - from django import forms - from contact.forms import ContactForm - from django.utils.translation import ugettext_lazy as _ - - class RegistrationForm(ContactForm): - form_tag = 'register' - name = forms.CharField(label=_('Name'), max_length=128) - presentation = forms.FileField(label=_('Presentation')) - -some_template.html: - {% url 'contact:form' 'register' %} - -""" - -from fnpdjango.utils.app import AppSettings - - -class Settings(AppSettings): - FORMS_MODULE = "contact_forms" - - -app_settings = Settings('CONTACT')