{"id":18457181,"url":"https://github.com/redsolution/django-simple-feedback","last_synced_at":"2025-04-08T05:33:23.052Z","repository":{"id":49653661,"uuid":"778723","full_name":"redsolution/django-simple-feedback","owner":"redsolution","description":"Simple Django feedback application","archived":false,"fork":false,"pushed_at":"2024-08-27T04:35:52.000Z","size":138,"stargazers_count":18,"open_issues_count":2,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-23T06:41:28.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://readthedocs.org/docs/django-simple-feedback/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redsolution.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-07-16T12:17:24.000Z","updated_at":"2024-09-19T04:31:30.000Z","dependencies_parsed_at":"2024-08-27T05:39:33.840Z","dependency_job_id":"ff9dba7f-2f57-43f6-8113-a5bf00853988","html_url":"https://github.com/redsolution/django-simple-feedback","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsolution%2Fdjango-simple-feedback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsolution%2Fdjango-simple-feedback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsolution%2Fdjango-simple-feedback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsolution%2Fdjango-simple-feedback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redsolution","download_url":"https://codeload.github.com/redsolution/django-simple-feedback/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785864,"owners_count":20995641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-06T08:13:40.578Z","updated_at":"2025-04-08T05:33:22.535Z","avatar_url":"https://github.com/redsolution.png","language":"Python","readme":"# Django feedback application\n\n\nOpen source feedback management system based on the Django framework. You can easily and flexibly embed any feedback form for your site. When the form is submitted you receive an email message containing the form data\n\n## Features\n- Easy installation and high level of customization.\n- Works through AJAX (without page refresh)\n- Flexible configuration of e-mail recipients and email message format.\n- Built-in anti-spam protection and easy integration with any additional protection.\n- Webpack/gulp compatible.\n\n## Requirements\n- Django 2.2.*\n- Python 3.5\n\n## Installation and basic usage\n\n1. Install package\n\n    `` pip install git+git://github.com/shoker174/django-simple-feedback.git``\n\n2. Create (or use) your own application for your feedback forms, for example ``custom_feedback``\n3. Configure your setting file:\n\n    - **FEEDBACK_FORMS** - Registry for feedback forms (*required*).\n    - **FEEDBACK_FORMS_NAMES** - Registry for feedback form names (*required*).\n    - **FEEDBACK_PREFIX_KEY_FIELDS** - Use True if need unique id html element for form fields. Recommended when more than one form (*default: False*).\n    - **FEEDBACK_ANTISPAM** - dictionary antispam settings. Include next settings:\n        - CHECKING_HIDDEN_FIELD - adding and checking hidden antispam fields in the form (*default: True*)\n        - BLOCKING_EXTERNAL_LINKS - checking form content for external links (*default: True*)\n    - **FEEDBACK_ADMIN_EXTRA_CLASS** - Admin page customizing: dictionary of extra css classes for fields (*default empty*). For example:\n        ``FEEDBACK_ADMIN_EXTRA_CLASS = {'all': 'my-class'}``\n    - **FEEDBACK_ADMIN_EXTRA_CSS** - Admin page customizing: dictionary of extra css files for mailing list admin page (*default empty*). For example:\n        ``FEEDBACK_ADMIN_EXTRA_CSS = {'all': ['css/admin/common.css']}``\n\n    Simple settings configuration:\n\n    ```python\n    # django email settings if they does not exist\n    DEFAULT_FROM_EMAIL = 'no-reply@mysite.com'\n    MANAGERS = [\n        ('websupport', 'websupport+mysite@mycomany.com'),\n    ]\n    EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # for local testing\n\n    # feedback settings\n    INSTALLED_APPS += ['feedback', '\u003cPROJECT_ROOT\u003e.custom_feedback']\n    FEEDBACK_FORMS = {\n        'my_form': '\u003cPROJECT_ROOT\u003e.custom_feedback.forms.MyForm',\n    }\n    FEEDBACK_FORMS_NAMES = {\n        'default':  '-- default --',\n        'my_form':  'My form name',\n    }\n    FEEDBACK_PREFIX_KEY_FIELDS = True\n    ```\n\n4. Add urlpattern to main urls.py:\n\n    ```python\n    urlpatterns = [\n        ...\n        url(r'^feedback/', include('feedback.urls')),\n        ...\n    ]\n    ```\n5. Create your custom form in directory according to FEEDBACK_FORMS settings. For example in dir ``\u003cPROJECT_ROOT\u003e.custom_feedback.forms``\n    ```python\n    from feedback.forms import BaseFeedbackForm\n\n    class CallForm(BaseFeedbackForm):\n\n        name = forms.CharField()\n        email = forms.EmailField()\n        phone = forms.CharField()\n    ```\n6. Call the form in the html template according FEEDBACK_FORMS settings\n\n    ```html\n    {% load feedback_tags %}\n    ...\n    \u003c!--noindex--\u003e\n        {% show_feedback 'my_form' %}\n    \u003c!--/noindex--\u003e\n    ```\n    Any feedback form include three states (and accordingly three templates):\n    - presentation of form (feedback.html)\n    - message after success form sending (thankyou.html)\n    - message displayed when spam is blocked (spam.html)\n\n7. Apply migrations and run local server\n\n    ```python\n    python manage.py migrate feedback\n    python manage.py runserver\n    ```\n\n8. Create and configure recipients email adresses and mailing list for your custom form in admin.\n\n    Pay attention to the next mailing list fields:\n    - **Form title** - text displayed in form templates as form title.\n    - **List of addresses** - customize email recipients list instead of MANAGERS settings.\n    - **Default sender email** - customize email sender instead of DEFAULT_FROM_EMAIL settings.\n    - **Success message** - text displayed after success form sending.\n    - **Message subject** - topic for email message.\n    - **Message template** - email message template. All fields of the form are available in the field as variables in brackets. For example:\n        ```html\n        Name: {{ name }}\n        E-mail: {{ email }}\n        Phone: {{ phone }}\n        ```\n**Configure is done!**\n\n## Advansed usage\n\n### Templates structure\nTo customize any feedback template, stick to the following template structure:\n- templates/\n    - feedback/\n        - my_form/\n            - feedback.html\n        - feedback.html\n        - thankyou.html\n        - spam.html\n        - field.html\n\nFor example, when the \"my_form\" is rendered, the following priority applies:\n1. \u003cPROJECT_ROOT\u003e/templates/feedback/my_form/feedback.html\n2. \u003cPROJECT_ROOT\u003e/templates/feedback/feedback.html\n3. feedback/templates/feedback/feedback.html # default template from app\n\nThe following structure is most userfull:\n- templates/\n    - feedback/\n        - my_form_1/\n            - feedback.html # customized form template\n        - my_form_2/\n            - feedback.html\n        - thankyou.html # common templates for all forms\n        - spam.html\n        - field.html\n\n### Form template\nDefault form contains javascript from ``{{ form.media }}``. If your customize templates we recomended instead of ``{{ form.media }}`` include script in your base template footer:\n\n```html\n\u003cscript type=\"text/javascript\" src=\"/static/feedback/js/feedback.js\"\u003e\u003c/script\u003e\n```\nOr copy file content in your main.js file\n\nAbout form customization:\n\n1. To display form fields in the basic order, use default field output.\n\n    **feedback.html**:\n    ```html\n    {% load feedback_tags %}\n    \u003cform\u003e\n        ...\n        {% for field in form.hidden_fields %}{{ field }}{% endfor %}\n        {% for field in form.visible_fields %}\n            {% show_field %}\n        {% endfor %}\n        ...\n    \u003c/form\u003e\n\n    ```\n    In this example, hidden fields are rendered first, and then visible fields are rendered.\n\n2. To separate fields into different groups:\n\n    **forms.py**:\n    ```python\n    from feedback.forms import BaseFeedbackForm\n\n    class CallForm(BaseFeedbackForm):\n\n        name = forms.CharField(widget=forms.TextInput(attrs={'data-set': 1}))\n        email = forms.EmailField(widget=forms.TextInput(attrs={'data-set': 2}))\n        phone = forms.CharField(widget=forms.TextInput(attrs={'data-set': 1}))\n\n    ```\n    In this example we need to separate fields in two groups: \"name\" and         \"phone\" in first group and \"email\" in second group.\n\n    **feedback.html**:\n    ```html\n    {% load feedback_tags %}\n    \u003cform\u003e\n        ...\n        {% for field in form.hidden_fields %}{{ field }}{% endfor %}\n\n        \u003cdiv class=\"form__row\"\u003e\n            \u003cdiv class=\"form__col\"\u003e\n                {% for field in form %}\n                    {% show_field field set 1 %}\n                {% endfor %}\n            \u003c/div\u003e\n            \u003cdiv class=\"form__col\"\u003e\n                {% for field in form %}\n                    {% show_field field set 2 %}\n                {% endfor %}\n            \u003c/div\u003e\n        \u003c/div\u003e\n        ...\n    \u003c/form\u003e\n\n    ```\n\n### Field template\n\nField rendering is associated with code duplication. To avoid this, use the template tag ``{% show_field %}``.\n\nTag gets two parameters: \"field\" and \"set\" (*optional*). Rendered template get context and two additional varibles\n- **atts** - field widget attributes form forms.py\n- **input_type** - to separate different fields\n\n**field.html**\n\n```html\n\u003clabel {{ attrs }} {% if field.errors %}class=\"error\"{% endif %}\u003e\n\t\u003cspan\u003e{{ field.label }}\u003c/span\u003e\n\t{{ field }}\n\u003c/label\u003e\n```\nWe can combine of ``field.name`` and ``input_type`` to identify any field:\n\n```html\n{% if input_type == 'hidden' %}\n     {{ field }}\n{% elif input_type == 'select' %}\n     \u003cdiv class=\"{{ attrs.class }}{% if field.errors %} error{% endif %}\"\u003e\n        \u003clabel\u003e\n            \u003cselect required name=\"{{ field.html_name }}\" id=\"id_{{ field.html_name }}\"\u003e\n              {% for value, name in field.field.choices %}\n                    \u003coption {% if field.value|equal:value %}selected{% endif %} value=\"{{ value }}\"\u003e{{ name }}\u003c/option\u003e\n              {% endfor %}\n            \u003c/select\u003e\n            {% if field.label %}\u003cspan\u003e{{ field.label }}\u003c/span\u003e{% endif %}\n        \u003c/label\u003e\n    \u003c/div\u003e\n{% elif field.name == 'captcha' %}\n\t{{ field }}\n{% else %}\n     \u003cdiv class=\"{{ attrs.class }}{% if field.errors %} error{% endif %}\"\u003e\n        \u003clabel\u003e\n            \u003cspan\u003e{{ field.label }}\u003c/span\u003e\n\t    \t{{ field }}\n        \u003c/label\u003e\n    \u003c/div\u003e\n{% endif %}\n```\n### Additionally\n- Administrative interface: to connect the HTML-editor to the \"success message\" field, install ``django_tinymce`` package (tested for version 2.6.0)\n\n\t`` pip install django_tinymce==2.6.0 ``\n- If you need additional protection, easy integration with Google reCaptcha v2. Package is available [here](https://github.com/oldroute/django-nocaptcha-recaptcha):\n\n\t``pip install git+git://github.com/oldroute/django-nocaptcha-recaptcha.git\n``\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredsolution%2Fdjango-simple-feedback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredsolution%2Fdjango-simple-feedback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredsolution%2Fdjango-simple-feedback/lists"}