A Django-based queue management system with SMS notifications for token status updates.
- Token generation with SMS notifications
- Real-time queue status updates
- Admin dashboard for queue management
- Automatic counter assignment
- SMS notifications for:
- Token creation
- Service ready notifications
- Next-in-line alerts
- Clone the repository:
git clone https://github.com/restapi404/Queue-Management-System.git
cd Queue-Management-System- Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1 # On Windows- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration:
# - TWILIO_ACCOUNT_SID
# - TWILIO_AUTH_TOKEN
# - TWILIO_MESSAGING_SERVICE_SID
# - TWILIO_PHONE_NUMBER- Apply migrations:
python manage.py migrate- Create a superuser:
python manage.py createsuperuserThe application requires two components to run:
- The Django development server:
python manage.py runserver- The automatic token assignment process (in a separate terminal):
python manage.py auto_assign_tokensThe auto-assignment process continuously:
- Assigns waiting tokens to available counters
- Maintains queue fairness (configurable threshold)
- Auto-completes tokens that exceed maximum serving time
- Sends SMS notifications for status changes
Important: Both processes need to be running for automatic counter assignment to work.
- Main application: http://127.0.0.1:8000/
- Admin interface: http://127.0.0.1:8000/admin/
- Queue status: http://127.0.0.1:8000/status/<token_number>/
- Admin dashboard: http://127.0.0.1:8000/admin-dashboard/
- Uses SQLite database by default (db.sqlite3)
- Admin-only views require staff/superuser access
- Reset/clear all tokens via Admin Dashboard
- SMS notifications require valid Twilio credentials
- Configure fairness settings in environment:
- FAIRNESS_THRESHOLD (default: 3 tokens)
- AUTO_ASSIGN_INTERVAL (default: 5 seconds)
- MAX_SERVING_TIME (default: 10 minutes)