Django views and forms that submit tickets to Zendesk
Project description
An extensible library to add Django views with forms to submit tickets to Zendesk.
Usage
Add these to your settings.py:
ZENDESK_BASE_URL = 'https://example.zendesk.com'
ZENDESK_API_USERNAME = ...
ZENDESK_API_TOKEN = ...
ZENDESK_REQUESTER_ID = ...
ZENDESK_GROUP_ID = ...
Add an entry to your urls.py
from zendesk_tickets import views
url(r'^submit_ticket/$', views.TicketView.as_view(
success_url='/',
template_name='app_name/submit_ticket_page.html',
ticket_subject='Website Feedback',
ticket_tags=['website', 'feedback']
ticket_template_name='app_name/feedback_ticket.txt',
), name='submit_ticket'),
If you wish to include additional fields, subclass BaseTicketForm and add them. If you wish to include them in the body of the ticket, create a new ticket template and pass it as the ticket_template_name. If you wish to include them as custom fields, define the following in your settings.py:
ZENDESK_CUSTOM_FIELDS = {
'referer': 31, # zendesk field id
'username': 32,
'user_agent': 33,
}
The three fields in the example above are included in TicketForm by default and can be included in your ticket by referencing them in the ticket template or specifying custom field ids in settings.
Development
Please report bugs and open pull requests on GitHub.
Use python setup.py test to run all tests.
If any localisable strings change, run python setup.py makemessages compilemessages.
Distribute a new version to PyPi by updating the VERSION tuple in zendesk_tickets and publishing a release in GitHub (this triggers a GitHub Actions workflow to automatically upload it). Alternatively, run python setup.py compilemessages sdist bdist_wheel upload locally.
Copyright
Copyright (C) 2020 HM Government (Ministry of Justice Digital & Technology). See LICENSE.txt for further details.
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
File details
Details for the file django-zendesk-tickets-0.14.tar.gz
.
File metadata
- Download URL: django-zendesk-tickets-0.14.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6ccd33b504980e60bd09ef3ee9be7ae8c060bc90dfb1cd4568e3af5c9939158 |
|
MD5 | 9790dbf5ca7d29013ad83c57097e51f5 |
|
BLAKE2b-256 | 99e8b0fa570225d1d62e6c6629533187e75ada54bbb67c00a8be91d8d8fdc0fd |
Provenance
File details
Details for the file django_zendesk_tickets-0.14-py2.py3-none-any.whl
.
File metadata
- Download URL: django_zendesk_tickets-0.14-py2.py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1932b45e26154bd94b10a217abbbec080b1669f4991699a5c387db45134f2582 |
|
MD5 | 4ae2882f630672f258e8f7b89bfff06b |
|
BLAKE2b-256 | 1a1dee5e23e9d1927a675367c7ff4cc24f19c9e394320fbea879db5ed92d00ad |