Skip to main content

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 forms
from zendesk_tickets import views

url(r'^submit_ticket/$', views.ticket, {
        'template_name': 'xxx/submit_ticket_page.html',
        'success_redirect_url': '/',
        'ticket_template_name': 'zendesk_tickets/ticket.txt',
        'form_class': forms.TicketForm,
        'subject': 'Website Ticket',
        'tags': [],
        'extra_context': {},
    }, 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 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.

Source Distribution

django-zendesk-tickets-0.11.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

django_zendesk_tickets-0.11-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file django-zendesk-tickets-0.11.tar.gz.

File metadata

File hashes

Hashes for django-zendesk-tickets-0.11.tar.gz
Algorithm Hash digest
SHA256 b3bccdaec5185c5d9e1e33b7b14f78832a89ed869be69b7ce1ad862d4564db46
MD5 23efb9ebced09303ebf920d1159ae30b
BLAKE2b-256 3244d49c914795cb4ba2e23d7dcb5e2f442fda1082416c303daea5a0a109358a

See more details on using hashes here.

Provenance

File details

Details for the file django_zendesk_tickets-0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for django_zendesk_tickets-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 0d97e2febc5957a5c59e7f92ba9dc48e62d15379763c104f057f3c0e4853a4c2
MD5 7ffe86a6e6e84d11b64fb23331202f6b
BLAKE2b-256 c176eb8984d9a8e628622f5eb73e6739702902c739d05058a802cede30e90144

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page