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"],
}
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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681ff64bcd60d7e505521da2a66ecef099007ad66e3eea0112a0b3e30d81c63e |
|
MD5 | 332f3aa688e1ff67c22cc613bb9f2919 |
|
BLAKE2b-256 | 6b53b93e21aabcfaa7bf85b0564d32c4b92a213ed8e8c835fc6105ec61498f89 |
Hashes for django_feedback_govuk-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9547cf18bf125bfcaf8d20b95768925d818e8a9ed25add82349b0b409a2dd09a |
|
MD5 | 7598e4a95af669ea9d2c451c25f87c29 |
|
BLAKE2b-256 | f3014df855df132aeb12f5a523b29412884002a494c9db3893a5bb5f573c904c |