Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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

https://travis-ci.org/ministryofjustice/django-zendesk-tickets.svg?branch=master

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 run python setup.py compilemessages sdist bdist_wheel upload.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-zendesk-tickets, version 0.12
Filename, size File type Python version Upload date Hashes
Filename, size django_zendesk_tickets-0.12-py3-none-any.whl (10.8 kB) File type Wheel Python version 3.6 Upload date Hashes View hashes
Filename, size django-zendesk-tickets-0.12.tar.gz (7.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page