{"id":13427470,"url":"https://github.com/django-fluent/fluentcms-contactform","last_synced_at":"2026-03-01T02:04:40.258Z","repository":{"id":57431539,"uuid":"44862890","full_name":"django-fluent/fluentcms-contactform","owner":"django-fluent","description":"A contact form plugin django-fluent-contents","archived":false,"fork":false,"pushed_at":"2021-11-16T11:21:27.000Z","size":80,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T16:02:07.101Z","etag":null,"topics":["bootstrap3","contact-form","django-fluent"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/django-fluent.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-24T11:17:49.000Z","updated_at":"2021-11-16T11:21:30.000Z","dependencies_parsed_at":"2022-09-02T11:01:08.140Z","dependency_job_id":null,"html_url":"https://github.com/django-fluent/fluentcms-contactform","commit_stats":null,"previous_names":["edoburu/fluentcms-contactform"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/django-fluent/fluentcms-contactform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-fluent%2Ffluentcms-contactform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-fluent%2Ffluentcms-contactform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-fluent%2Ffluentcms-contactform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-fluent%2Ffluentcms-contactform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/django-fluent","download_url":"https://codeload.github.com/django-fluent/fluentcms-contactform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-fluent%2Ffluentcms-contactform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29958416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap3","contact-form","django-fluent"],"created_at":"2024-07-31T01:00:28.707Z","updated_at":"2026-03-01T02:04:40.202Z","avatar_url":"https://github.com/django-fluent.png","language":"Python","funding_links":[],"categories":["Content Plugins"],"sub_categories":[],"readme":"fluentcms-contactform\n=====================\n\n.. image:: https://github.com/django-fluent/fluentcms-contactform/actions/workflows/tests.yaml/badge.svg?branch=master\n    :target: https://github.com/django-fluent/fluentcms-contactform/actions/workflows/tests.yaml\n.. image:: https://img.shields.io/pypi/v/fluentcms-contactform.svg\n    :target: https://pypi.python.org/pypi/fluentcms-contactform/\n.. image:: https://img.shields.io/pypi/l/fluentcms-contactform.svg\n    :target: https://pypi.python.org/pypi/fluentcms-contactform/\n.. image:: https://img.shields.io/codecov/c/github/django-fluent/fluentcms-contactform/master.svg\n    :target: https://codecov.io/github/django-fluent/fluentcms-contactform?branch=master\n\n\nA plugin for django-fluent-contents_ to show a simple contact form.\n\nFeatures:\n\n* Configurable fields.\n* Configurable layouts.\n* Phone number validation.\n* IP-Address detection.\n* Admin panel with submitted messages.\n* Email notification to staff members for new messages.\n* Optional capcha / reCAPTCHA support.\n\nInstallation\n============\n\nFirst install the module, preferably in a virtual environment. It can be installed from PyPI::\n\n    pip install fluentcms-contactform\n\n\nBackend Configuration\n---------------------\n\nFirst make sure the project is configured for django-fluent-contents_.\n\nThen add the following settings:\n\n.. code-block:: python\n\n    INSTALLED_APPS += (\n        'fluentcms_contactform',\n        'crispy_forms',    # for default template\n    )\n\nThe database tables can be created afterwards::\n\n    ./manage.py migrate\n\nNow, the ``ContactFormPlugin`` can be added to your ``PlaceholderField``\nand ``PlaceholderEditorAdmin`` admin screens.\n\nMake sure the following settings are configured:\n\n.. code-block:: python\n\n    DEFAULT_FROM_EMAIL = '\"Your Name\" \u003cyou@example.org\u003e'\n\n    FLUENTCMS_CONTACTFORM_VIA = \"Sitename\"    # Will send a From: \"Username via Sitename\" email.\n\nTo have bootstrap 3 layouts, add:\n\n.. code-block:: python\n\n    CRISPY_TEMPLATE_PACK = 'bootstrap3'\n\n\nIP address detection\n~~~~~~~~~~~~~~~~~~~~\n\nThis package stores the remote IP of the visitor in the model.\nThe IP Address is read from the ``REMOTE_ADDR`` meta field.\nIn case your site is behind a HTTP proxy (e.g. using Gunicorn or a load balancer),\nthis would make all contact form submissions appear to be sent from the load balancer IP.\n\nThe best and most secure way to fix this, is using WsgiUnproxy_ middleware in your ``wsgi.py``:\n\n.. code-block:: python\n\n    from django.core.wsgi import get_wsgi_application\n    from django.conf import settings\n    from wsgiunproxy import unproxy\n\n    application = get_wsgi_application()\n    application = unproxy(trusted_proxies=settings.TRUSTED_X_FORWARDED_FOR_IPS)(application)\n\nIn your ``settings.py``, you can define which hosts may pass the ``X-Forwarded-For``\nheader in the HTTP request. For example:\n\n.. code-block:: python\n\n    TRUSTED_X_FORWARDED_FOR_IPS = (\n        '11.22.33.44',\n        '192.168.0.1',\n    )\n\n\nUpdating the form layout\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe default form fields can be changed using:\n\n.. code-block:: python\n\n    FLUENTCMS_CONTACTFORM_DEFAULT_FIELDS = ('name', 'email', 'phone_number', 'subject', 'message')\n\n    # default CSS styles\n    CRISPY_TEMPLATE_PACK = 'bootstrap3'\n    FLUENTCMS_CONTACTFORM_FORM_CSS_CLASS = 'form-horizontal'\n    FLUENTCMS_CONTACTFORM_LABEL_CSS_CLASS = 'col-xs-3'\n    FLUENTCMS_CONTACTFORM_FIELD_CSS_CLASS = 'col-xs-9'\n\nFor example, the subject can be removed using:\n\n.. code-block:: python\n\n    FLUENTCMS_CONTACTFORM_DEFAULT_FIELDS = ('name', 'email', 'phone_number', 'message')\n\n\nAdding form fields\n~~~~~~~~~~~~~~~~~~\n\nThe form layout is fully configurable, as you can select your own form classes.\nThe default settings are:\n\n.. code-block:: python\n\n    FLUENTCMS_CONTACTFORM_STYLES = (\n        ('default', {\n            'title': _(\"Default\"),\n            'form_class': 'fluentcms_contactform.forms.default.DefaultContactForm',\n            'required_apps': (),\n        }),\n        ('captcha', {\n            'title': _(\"Default with captcha\"),\n            'form_class': 'fluentcms_contactform.forms.captcha.CaptchaContactForm',\n            'required_apps': ('captcha',),\n        }),\n        ('recaptcha', {\n            'title': _(\"Default with reCAPTCHA\"),\n            'form_class': 'fluentcms_contactform.forms.recaptcha.ReCaptchaContactForm',\n            'required_apps': ('captcha',),\n        }),\n    )\n\nYou can provide any form class, as long as it inherits from ``fluentcms_contactform.forms.AbstractContactForm``.\nThe current implementation expects the form to be a model form,\nso any submitted data is safely stored in the database too.\n\nBy providing a ``helper`` function, the form fields received default styling from django-crispy-forms_.\nSee the provided form code in ``fluentcms_contactform.forms`` for examples.\n\nThe form is rendered with the ``fluentcms_contactform/forms/*name*.html`` template.\n\nDisplaying phone numbers\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe phone number field uses django-phonenumber-field_ to validate the phone number.\nBy default, it requires an international notation starting with ``+``.\nThe ``PhoneNumberField`` can support national phone numbers too, \nwhich is useful when most visitors come from a single country.\nUpdate the ``PHONENUMBER_DEFAULT_REGION`` setting to reflect this.\n\nFor example, to auto insert a ``+31`` prefix for Dutch phone numbers, use:\n\n.. code-block:: python\n\n    PHONENUMBER_DEFAULT_REGION = 'NL'   # Your country code, eg. .NL to \n\nThe phone numbers can be displayed in various formats, the most human readable is:\n\n.. code-block:: python\n\n    PHONENUMBER_DEFAULT_FORMAT = 'NATIONAL'\n\nThe supported formats are:\n\n* ``NATIONAL`` - nicely space separated, remove the country prefix.\n* ``INTERNATIONAL`` - nicely space separated\n* ``E164`` - all numbers, suitable for data transmission.\n* ``RFC3966`` - the ``tel:`` URL, suitable for URL display.\n\n\nDisplaying captcha's\n~~~~~~~~~~~~~~~~~~~~\n\nThe ``fluentcms_contactform.forms.captcha`` provides an example to create a captcha form.\nThis requires a properly installed django-simple-captcha_ form::\n\n    pip install django-simple-captcha\n\nIn ``settings.py``:\n\n.. code-block:: python\n\n    INSTALLED_APPS += (\n        'captcha',\n    )\n\nIn ``urls.py``:\n\n.. code-block:: python\n\n    urlpatterns = [\n        # ...\n\n        url(r'^api/captcha/', include('captcha.urls')),\n\n    ]\n\nAdd the database tables::\n\n    python manage.py migrate\n\nAnd optional settings to simplify the captcha:\n\n.. code-block:: python\n\n    CAPTCHA_NOISE_FUNCTIONS = ()\n    CAPTCHA_FONT_SIZE = 30\n    CAPTCHA_LETTER_ROTATION = (-10,10)\n\nThis can be made more complicated when needed:\n\n.. code-block:: python\n\n    CAPTCHA_CHALLENGE_FUNCT = 'captcha.helpers.math_challenge'\n    CAPTCHA_NOISE_FUNCTIONS = (\n        'captcha.helpers.noise_arcs',\n        'captcha.helpers.noise_dots',\n    )\n\nSee the documentation of django-simple-captcha_ for more examples.\n\nUsing reCAPTCHA\n~~~~~~~~~~~~~~~\n\nIn a similar way, you can use recapcha. Select the form option,\nand make sure everything is installed::\n\n    pip install django-recaptcha\n\nIn ``settings.py``:\n\n.. code-block:: python\n\n    INSTALLED_APPS += (\n        'captcha',\n    )\n\n    RECAPTCHA_PUBLIC_KEY = '...'\n    RECAPTCHA_PRIVATE_KEY = '...'\n    RECAPTCHA_USE_SSL = True\n    NOCAPTCHA = True  # Use the new nocapcha\n\nSee the documentation of django-recaptcha_ for more details.\n\n.. warning::\n    Don't install both django-simple-captcha_ and django-recaptcha_ as they both install\n    a ``captcha`` package in the same location.\n\n\nFrontend Configuration\n----------------------\n\nIf needed, the HTML code can be overwritten by redefining ``fluentcms_contactform/forms/*.html``.\n\nThe template filename corresponds with the form style defined in ``FLUENTCMS_CONTACTFORM_STYLES``.\nWhen no custom template is defined, ``fluentcms_contactform/forms/default.html`` will be used.\n\nThe staff email message can be updated by redefining ``fluentcms_contactform/staff_email/*.txt``,\nwhich works similar to the form templates.\n\n\nContributing\n------------\n\nIf you like this module, forked it, or would like to improve it, please let us know!\nPull requests are welcome too. :-)\n\n.. _django-fluent-contents: https://github.com/django-fluent/django-fluent-contents\n.. _django-phonenumber-field: https://github.com/stefanfoulis/django-phonenumber-field\n.. _django-simple-captcha: https://github.com/mbi/django-simple-captcha\n.. _django-recaptcha: https://github.com/praekelt/django-recaptcha\n.. _django-crispy-forms: https://github.com/maraujop/django-crispy-forms\n.. _WsgiUnproxy: https://pypi.python.org/pypi/WsgiUnproxy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-fluent%2Ffluentcms-contactform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjango-fluent%2Ffluentcms-contactform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-fluent%2Ffluentcms-contactform/lists"}