A ticket application for django project
Project description
django-ticket
Ticket application for django project
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:
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:
Thanks for attention
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_ticket-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e11ae23375bb84c7e751dd6fbef429513b59ff97d76d6c3b2501a8f47c8b5a |
|
MD5 | f2c9d95e7003b150b2ac2af9d1f05e6c |
|
BLAKE2b-256 | 936cc39b885efd47fa2e3cd5739bb99b12a42a94a597e9c6b904b7bb1e3a5e97 |