A Django app to gather and send internal Government staff feedback
Project description
django-feedback
A Django app to gather and send internal Government staff feedback, e.g. for open beta periods
Installation
pip install django-feedback-govuk
- Add
django-feedback
to your INSTALLED_APPS settings:
INSTALLED_APPS = [
...
'crispy_forms',
'crispy_forms_gds',
'django_feedback_govuk',
]
- Create a new email template in the GovUk Notify service, making sure to create a ((feedback_url)) field.
Note that ((feedback_url)) will be a link to the listing view, not an individual piece of feedback.
You'll need an API key and template ID from the gov.uk Notify service.
- Add the following settings to the file:
# Crispy forms
CRISPY_ALLOWED_TEMPLATE_PACKS = ["gds"]
CRISPY_TEMPLATE_PACK = "gds"
# Gov Notify
GOVUK_NOTIFY_API_KEY="<your-api-key>"
# Django Feedback GovUK
DJANGO_FEEDBACK_GOVUK = {
"SERVICE_NAME": "<your-service>",
"FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS": ["email@example.com"],
"COPY": {
#...add any copy tags to override here
}
}
The copy dict contains string IDs for all user-facing copy, defaulting to the following (override
just the fields you want to, using the `{{ service_name }}` variable if necessary for _title and _body strings):
```py
{
"SUBMIT_TITLE": "Give feedback on {{ service_name }}",
"CONFIRM_TITLE": "Feedback submitted",
"CONFIRM_BODY": "Thank you for submitting your feedback.",
"FIELD_SATISFACTION_LEGEND": "Overall, how did you feel about the service you received today?",
"FIELD_COMMENT_LEGEND": "How could we improve this service?",
"FIELD_COMMENT_HINT": "Do not include any personal or financial information, for example your National Insurance or credit card numbers.",
}
The email addresses are for every recipient that should get an email when feedback is submitted.
- Build your own templates
Override the built-in templates by making new templates in your app under the
django_feedback_govuk/templates
path. You'll need templates for submit.html
, confirm.html
and listing.html
, each of which should load its respective template tag from feedback_submit
,
feedback_confirm
and feedback_listing
.
For example:
{# /your-project/templates/django_feedback_govuk/templates/submit.html #}
{% extends "base.html" %}
{% load feedback_tags %}
{% block content %}
{% feedback_submit %}
{% endblock content %}
If you'd like to use the templatetags without causing page loads to new views
- Add the URLs to your project
from django_feedback_govuk import urls as feedback_urls
urlpatterns = [
...
path("feedback/", include(feedback_urls)),
...
]
- Set up user permissions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_feedback_govuk-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36ce651498651c676737b0886e6b77f31b36efc930a8d590bd04b746498a0b79 |
|
MD5 | 17c5d770b6388a92b028a01662d7992f |
|
BLAKE2b-256 | 14833eb3a9e8f80e6f81afdae04d223cc26d1122a221932c5c0db01eba7bb23a |
Hashes for django_feedback_govuk-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6cbf59797c67da6bb3f16b9ca9b7d070045ee6d029facb4e45bb117962f8fe4 |
|
MD5 | 341c14d56f5ccb9cb03009a9de055c8c |
|
BLAKE2b-256 | dfd6f6becc691ca1fa50e7aa0081ce86323848efd0fcd6e291a48b809af32d1e |