python3 -m pip install Django
python3 -m pip install djangorestframework
- cd to repo folder
- run
python3 manage.py runserver
python3 manage.py makemigrations
python3 manage.py migrate
- . -
root folder
- db.sqlite3 -
database
- manage.py -
Django management script
- mysite -
Development server main directory.
- asgi.py
- __init__.py
- __pycache__
- settings.py -
configuration file
- urls.py -
mapping urls to apps
- wsgi.py
- README.md
- VitalGuard -
App main folder. Each development server may contain multiple apps, and each app may be transferred to different development servers before deployment.
- admin.py -
Define which models(database tables) are present in Django administration tool
- apps.py
- __init__.py
- migrations
- models.py -
Database architecture definition
- __pycache__
- serializers.py -
Classes for serializing data in order to work with API
- templates -
Frontend design files
- VitalGuard
- login.html
- patient_entry.html
- VitalGuard
- tests.py
- urls.py -
Mapping url patterns to views
- views.py -
Request handling logic (API)
- admin.py -
https://7cnhwvk6-8000.euw.devtunnels.ms/
curl -X POST http://127.0.0.1:8000/vitalguard/api/measurement/ \
-H "Content-Type: application/json" \
-d '{
"patient": 1,
"time_taken": "1911-05-26T12:34:56Z",
"heart_rate": 99,
"body_temp": 99,
"ox_saturation": 99,
"blood_pressure": 99
}' > res.html
curl -X POST http://127.0.0.1:8000/vitalguard/api/users/check_credentials/ \
-H "Content-Type: application/json" \
-d '{
"email": "j_smith@example.com",
"password": "12345"
}'
curl -X POST http://127.0.0.1:8000/vitalguard/api/device/pair_req/ \
-H "Content-Type: application/json" \
-d '{
"device_tag": "test_device_tag"
}'
curl -X GET http://127.0.0.1:8000/vitalguard/api/users/get_measurements/ \
-H "Content-Type: application/json" \
-d '{
"patient_id": "1"
}'
curl -X POST http://127.0.0.1:8000/vitalguard/api/users/register/ \
-H "Content-Type: application/json" \
-d '{
"name": "A B",
"username": "asfasf",
"email": "asfdadf@google.com",
"password": "afqefgqeg",
"user_type": "CT",
"device_tag": "qfeqf"
}'