The Django Patient Activity Tracker is a RESTful API designed to register patients and track their activity durations. This project uses Django REST framework to create endpoints for managing patients and their activities.
- Patient Registration: Add new patients with their details.
- Activity Tracking: Start and end activity durations for patients.
- Time Zone: Automatically handles time zone settings (Asia/Tashkent).
-
Clone the repository:
git clone https://github.com/azizbekrakhimjonov/django-patient-activity.git cd django-patient-activity -
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the server:
python manage.py runserver
- List Patients:
GET /patients/ - Create Patient:
POST /patients/ - Retrieve Patient:
GET /patients/{id}/ - Update Patient:
PUT /patients/{id}/ - Delete Patient:
DELETE /patients/{id}/
- Start Activity:
POST /patients/{id}/start/ - End Activity:
POST /patients/{id}/end/
curl -X POST http://127.0.0.1:8000/patients/ \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"age": 30,
"mobile_number": "1234567890"
}'