Skip to main content

A reusable app to add a basic and configurable contact form.

Project description

Contact Form App
================

This is aimed to be a reusable app for our cookiecutter.
Django CMS integration is provided.
It add a generic contact form with some basic configuration made available via the admin.


Install
-------

- create your virtualenv and `pip install -r requirements.txt`. For dev purposes, `pip install -r requirements-dev.txt`.

- In your `INSTALLED_APPS`, add:

```python
'modeltranslation', # translation within models
...
'django.contrib.site',
'django.contrib.sitemaps',

'django-countries', # needed for the CountryField
'crispy_forms', # nice looking forms
'crispy_forms_foundation',
'captcha',
'emencia_contact_form',
```

`modeltranslation` should be placed on top of the installed apps.

There is an automatic check which makes sure all of these apps are in INSTALLED_APPS.

- captcha: signup for [recaptcha](https://github.com/praekelt/django-recaptcha) and follow their installation process on their repo. (adding RECAPTCHA_PUBLIC_KEY, RECAPTCHA_PRIVATE_KEY in your settings and so on..)

- Add url(r'^', include('emencia_contact_form.urls')) in your urls.py

- Ensure you're using foundation with crispyforms, in your settings, add:

```python
CRISPY_ALLOWED_TEMPLATE_PACKS = (
'bootstrap',
'uni_form',
'bootstrap3',
'bootstrap4',
'foundation-5',
)
CRISPY_TEMPLATE_PACK = 'foundation-5'
```

Configuration
-------------

- Site: in django Admin, rename the site by default. Ensure you have SITE_ID = 1 in your settings.py

- You can then edit the ContactFormSettings in the admin to configure the email.

- EMAIL BACKEND: on success, the contact form send an email. You need to have it configured to have it working properly. [Django Email Backend](https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-EMAIL_BACKEND)

- sitemaps: A sitemap is available in contact_form/sitemaps.py
Configuration on the django settings and url has to be done. [doc](https://docs.djangoproject.com/en/1.10/ref/contrib/sitemaps/)


TEST & DEV
----------

There is requirements-dev.txt with pdb, django-extensions and pygraphviz.

Run tests with the following command:
`pytest`

To create a new db while running tests: `pytest --create-db`
The default behavior reuse the same db for performance reasons

Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emencia_contact_form-0.3.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

emencia_contact_form-0.3-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file emencia_contact_form-0.3.tar.gz.

File metadata

File hashes

Hashes for emencia_contact_form-0.3.tar.gz
Algorithm Hash digest
SHA256 517b4719146e8561e8fd5e7946f79441f7f6376f224f294dd5cedbcebfc0958c
MD5 fe93c07450cac319dbebb607bc30ba9f
BLAKE2b-256 3a3e056765bf9361b174e18e1876883f94ad4522f3791fbd5840c71375864d29

See more details on using hashes here.

File details

Details for the file emencia_contact_form-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for emencia_contact_form-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5dcb4afc4bb5445059520cf41f3a80647e8b03735b0b6c14415fe3a6e7379e99
MD5 816e899fd44d59a80f61597fbd7aefc8
BLAKE2b-256 9d43997645ed06c15399dbb96838f413794f8ff19a83292888cfdae0f39ce772

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page