A Django-based web application built using Django Rest Framework (DRF) for managing and tracking incidents. This system enables users to report, view, update, and manage incidents. The application ensures secure access by associating incidents with specific users, preventing updates to closed incidents, and providing a unique incident ID generation system.
- Incident Creation: Allows users to create incidents with essential details like priority, status, and type (Enterprise or Government).
- Unique Incident IDs: Automatically generates a unique Incident ID when creating a new incident. The format is
RMG<random_number><year>
. - User-based Access: Users can only view or edit incidents that they have reported. Closed incidents cannot be modified.
- Search Functionality: Users can search incidents by their unique Incident ID.
- RESTful API: A well-defined set of endpoints to interact with incidents.
- Swagger Integration: Interactive API documentation for easy testing and debugging.
- Backend Framework: Django and Django Rest Framework (DRF)
- Authentication: Token-based authentication (JWT)
- Database: Mysql
- API Documentation: Swagger UI (for interactive testing)
- Programming Language: Python 3.8
- Libraries:
random
for generating random Incident IDs- Django ORM for database interactions
timezone
for handling time-based fields
- Python 3.8 or higher installed on your machine.
- pip (Python package manager) installed.
- Virtual environment tools like
venv
orvirtualenv
. - Mysql database sudo apt-get update sudo apt-get install mysql-server sudo mysql_secure_installation Create a Database and User in MySQL Open the MySQL command line tool: mysql -u root -p Create a new database for your Django project: CREATE DATABASE incident_management;
-
unzip the file:
cd incident-management-system
-
python -m venv venv source venv/bin/activate # For Linux/Mac venv\Scripts\activate
-
Install dependencies: pip install -r requirements.txt
-
Apply migrations to set up the database:
python manage.py makemigrations python manage.py migrate
-
Create a superuser for admin access:
python manage.py createsuperuser
-
Run the server:
python manage.py runserver
-
Open the API documentation: http://127.0.0.1:8000/swagger/ in your browser.