Skip to main content

A ticket application for Django projects

Project description

django-ticket

Ticket application for django project

Repository

You can find the source code and contribute to the project at the following link:

GitHub Repository

Installation

1. install package

pip install django-ticket

2. add this application in settings.INSTALLED_APPS :

INSTALLED_APPS = [
    # ...
    'ticket',
    # ...
]

3. create and migrate migrations in BASE_DIR:

python manage.py migrate ticket

4. in core application include application urls:

from django.urls import path , include

urlpatterns += path("ticket/", include("ticket.urls"))

when you pass this missions you will see this in your admin panel:

Screenshot from 2024-01-14 10-07-30

API Documentation:

You can create a Ticket from admin panel for a user to admin. Note that and you can do all this operations from admin to a user

.../create_ticket/

Create a ticket from user to admin and add a new message:

method: post

required keywords : ("title","section","priority","message")

.../add_message/

Add message to a ticket :

method: post

required keywords : ("ticket","message")

Note: ticket means ticket's id

.../close/

Close ticket.

method: patch

required keywords : ("ticket",)

Note: ticket means ticket's id

.../seen/

Change ticket to seen state from user

method: patch

required keywords : ("ticket",)

Note: ticket means ticket's id

.../get_my_tickets/

Get all tickets of user as a list

method: get

required keywords : just must to be authorized.

A little more Professional

You can filter and have not seen tickets in admin panel:

settings.py:

1. Add 'ticket/templates' to DIRS of TEMPLATES:

TEMPLATES = [
    {
            # ...
        'DIRS': ['ticket/templates'],
            # ...
    }
]

2.Add 'ticket.context_processors.get_pending_tickets' to context_processors OPTIONS:

TEMPLATES = [
    # ...
            "OPTIONS": {
            # ...
            "context_processors": [
                # ...
            'ticket.context_processors.get_pending_tickets'
                # ...
            ]
            # ...
    }
]
    # ...

Finally your application is complete to use:

Screenshot from 2024-01-14 10-19-39

Thanks for attention

Contributors

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-ticket-2.1.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

django_ticket-2.1.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file django-ticket-2.1.2.tar.gz.

File metadata

  • Download URL: django-ticket-2.1.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for django-ticket-2.1.2.tar.gz
Algorithm Hash digest
SHA256 195e39fbde16069fbe13fb8f7846f8543b4e64b7672b3059cb2e967adf4b8ca7
MD5 ab1d5fe73b30088446c58d182dab6e6b
BLAKE2b-256 5c511dd10e57726128aa57967e8e6f4f35708f7f5c7b35c67c72c2fde926f437

See more details on using hashes here.

File details

Details for the file django_ticket-2.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_ticket-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 10162db2f0fc4c7fd68fd20d285a56bf715e4694eed3c1110bbaef78e9c84239
MD5 2260b94139c6ebebe87244201c738f36
BLAKE2b-256 94057a3b1d67079cf3708c0991e4596987507a61aadbf53ff5895298bbac9b8c

See more details on using hashes here.

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