jenkins/release/: emencia-contact-form-0.5.1 metadata and description
A reusable app to add a basic and configurable contact form.
author | Adrien Brunet - Emencia |
author_email | adrien@emencia.com |
classifiers |
|
license | AGPL |
platform |
|
Because this project isn't in the mirror_whitelist
,
no releases from root/pypi are included.
File | Tox results | History |
---|---|---|
emencia_contact_form-0.5.1-py2.py3-none-any.whl
|
|
|
emencia_contact_form-0.5.1.tar.gz
|
|
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/)
- Settings `CONTACTFORM_RGPD_ENABLED` and `CONTACTFORM_TERMS_ENABLED` (booleans) to respectively enable 'rgpd' and 'terms' field which will be required to submit form.
- Settings `CONTACTFORM_RGPD_LABEL` and `CONTACTFORM_TERMS_LABEL` (strings) to respectively display a custom field label for 'rgpd' and 'terms' instead of default ones.
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
Render warnings:
<string>:25: (WARNING/2) Inline literal start-string without end-string.
================
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/)
- Settings `CONTACTFORM_RGPD_ENABLED` and `CONTACTFORM_TERMS_ENABLED` (booleans) to respectively enable 'rgpd' and 'terms' field which will be required to submit form.
- Settings `CONTACTFORM_RGPD_LABEL` and `CONTACTFORM_TERMS_LABEL` (strings) to respectively display a custom field label for 'rgpd' and 'terms' instead of default ones.
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
Render warnings:
<string>:25: (WARNING/2) Inline literal start-string without end-string.