Package: django-writeback
Writeback is a pluggable customizable Django app to collect feedback from site visitors using AJAX.InstallationInstall using pip:pip install django-writebackQuick startAdd “writeback” to your INSTALLED_APPS setting like this:INSTALLED_APPS += ('writeback', )Add context processor to your TEMPLATE_CONTEXT_PROCESSORS setting like this:TEMPLATE_CONTEXT_PROCESSORS += ('writeback.context.add_form', )Specify email settings WRITEBACK_EMAIL_NOTIFICATION_SUBJECT, WRITEBACK_EMAIL_NOTIFICATION_FROM and WRITEBACK_EMAIL_NOTIFICATION_TO_LIST. These will be used in email notifications.Runpython manage.py syncdbto synchronize the database.Runpython manage.py collectstaticorpython manage.py collectstatic-iadmin, if you want to omit collecting static for the admin app.Include the writeback URLconf in your project urls.py like this:url(r'^writeback/', include('writeback.urls')),Modify your base template:<!-- in header block -->
{% include "writeback/header.html" %}

<!-- in body block -->
{% include "writeback/button.html" %}Overrideemail_notification.htmlandbutton.htmltemplates.Model customizationTheMessagemodel, which is used for collecting feedback, can be extended:Create an app, for examplecustom_writebackwith a file, which shall contain class declaration, name it,models.py, for example.Add this newly created app to yourINSTALLED_APPSsetting like this:INSTALLED_APPS += ('custom_writeback', )Declare your abstract model class anew or, if you want to extend the base model, inherit it fromwriteback.models.MessageAbstractlike so:from writeback.models import MessageAbstract


class MyMessageAbstract(MessageAbstract):
    # define your custom fields

    class Meta(MessageAbstract.Meta):
        passRegister your class in the project’ssettings.py:WRITEBACK_MESSAGE_BASE_MODEL = 'custom_writeback.models.MyMessageAbstract'Define a new form, which shall be used for the new model.Form customizationIf you have overriden or customized theMessagemodel, you most probably need to customize the form. But even if you use the original model, you may want to change the formclean()method.Create an app, for examplecustom_writeback(if you haven’t already) with a file, which shall contain class declaration, name it,forms.py, for example.Add this newly created app to yourINSTALLED_APPSsetting like this:INSTALLED_APPS += ('custom_writeback', )Declare your new form-class like so:from django.utils.translation import ugettext_lazy as _
from django.forms import ValidationError

from writeback.forms import MessageCreateFormBase
from writeback.models import Message


class MessageCreateForm(MessageCreateFormBase):
    class Meta:
        model = Message
        exclude = ['date_created', 'middle_name', 'company', 'info']

    def clean(self):
        cleaned_data = super(MessageCreateFormBase, self).clean()
        name = cleaned_data.get("name")
        family_name = cleaned_data.get("family_name")
        phone = cleaned_data.get("phone")
        email = cleaned_data.get("email")

        if not (name or family_name or phone or email):
            raise ValidationError(_("Please, fill out at least one field."))

        return super(MessageCreateFormBase, self).clean()Register your class in the project’ssettings.py:WRITEBACK_MESSAGE_BASE_FORM = 'custom_writeback.forms.MessageCreateForm'