{ "info": { "author": "Julien Maupetit", "author_email": "julien@tailordev.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "TailorDev Contact\n=================\n\nA customizable contact form for your django projects.\n\nYou will find the documentation of this project on [readthedocs](http://django-tailordev-contact.readthedocs.org/).\n\n## Dependencies\n\nFor now, Django>=1.5 is the only dependency for this project to run on production, with python>=2.6. Currently, this application is not compatible with python 3.3. We are working on it.\n\n## Installation\n\nTo install TailorDev Contact, use pip:\n\n $ pip install django-tailordev-contact\n\nIf you intend to test or improve this application, first clone this repository and install the local dependencies:\n\n $ pip install -r requirements/local.txt\n\n## Configuration\n\nAdd `td_contact` and its dependencies to your `INSTALLED_APPS`:\n\n INSTALLED_APPS = (\n ...\n 'td_contact',\n ...\n )\n\nAdd `td_contact` urls to your project url patterns:\n\n urlpatterns = patterns('',\n ...\n url(r'^contact/', include('td_contact.urls')),\n ...\n )\n\nSet your `td_contact` rules in your `settings.py`, by adding something like:\n\n # Contact form\n TD_CONTACT_FORM_RULES = {\n 'default': {\n 'prefix': \"[Foo:contact]\",\n 'subject': \"General informations\",\n 'to': ('contact@foo.com', 'ceo@foo.com'),\n },\n 'partner': {\n 'prefix': \"[Foo:partner]\",\n 'subject': \"Partnership opportunity\",\n 'to': ('partner@foo.com', ),\n },\n 'jobs': {\n 'prefix': \"[Foo:jobs]\",\n 'subject': \"Job opportunity\",\n 'to': ('jobs@foo.com', ),\n },\n }\n\n`TD_CONTACT_FORM_RULES` is a simple dictionary where each key defines a new rule. Each rule is also a dictionary defining the email prefix & subject and the recipient list.\n\n> **Important note** : when a contact form has been successfully filled, the user is redirected to the website home page. Thereby, we use the [django messages framework](https://docs.djangoproject.com/en/1.5/ref/contrib/messages/) to inform our user of its request status. Remember to enable messages and add something like the following to your base template DOM:\n\n {% if messages %}\n
\n {% endif %}\n\nThis example works with the [zurb foundation framework](http://foundation.zurb.com/). Feel free to adapt this for your favorite framework.\n\n## Urls\n\nTailorDev Contact form defines 3 urls you may use in your templates:\n\n### `contact_form_rule`\n\nThis url has been designed to initialize your form with your own rule, *e.g.*:\n \n {% url 'contact_form_rule' 'jobs' %}\n\n### `user_contact_form_by_slug` and `user_contact_form_by_pk`\n\nDepending on your application, people may want to contact a registered user directly and you want an elegant url to point to. To do so, use the `user_contact_form_by_slug` in your templates, *e.g.*:\n\n {% url 'user_contact_form_by_slug' myuser.slug %}\n\nAlternatively, use the `user_contact_form_by_id` in your templates, like:\n\n {% url 'user_contact_form_by_pk' myuser.pk %}\n\nTo use this feature, activate the related option in your `settings.py`:\n\n TD_CONTACT_FORM_ALLOW_DIRECT_USER_CONTACT = True\n\n### `contact_form`\n\nThis base url points to your contact form. Nothing more to add.\n\n## Templates\n\n### Using the default templates\n\nIf you want to use our default templates, feel free to do so. But please note that:\n\n* You should create a base template to inherit from, visible as `_layouts/base.html`\n* Your form will appear in a `content` block\n* Two partial templates must be customized `contact/partials/contact_recipient.html` and `contact/partials/aside.html`\n\n### Using your own template(s)\n\nThe template-to-override used to render the form is visible as `contact/form.html`. The core part of the template may looks like:\n\n