Skip to content

Qu1ck1337/TicketSystemDjango

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to run

To start WSGI server

python manage.py runserver

To start ASGI server (WebSocket support)

daphne -p 8001 ticket_system.asgi:application

APIs

GET: events/ - get the list of all events

GET: events/<event_id> - get the detailed information of the event by event_id

  • event_id : UUID - uuid of event

POST: events/<event_id>/buy/ - to purchase a ticket for the event

  • event_id : UUID - uuid of event

Body parameters:

  • user : INT - id of user

WebSocket

/ws/tickets/<event_id}>

  • event_id : UUID - uuid of event

How to check WebSocket work

Run ASGI and WSGI server

Create an event in admin panel, then insert uuid to event_id in frontend/websocket_test.js

Then run websocket_test.js

cd frontend/
node websocket_test.js

To check the work add a ticket through events/<event_id>/buy/ post method or add in admin panel

Available tickets for the event will be displayed in every update for everyone who connected to WebSocket in specific event.

About

Learning project for Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published