Team Members Project
APIs -
- GET - http://127.0.0.1:8010/api/user/ (to get the list of all team members).
{
"is_success": true,
"message": null,
"response_data": [
{
"id": 1,
"first_name": "Rashmi",
"last_name": "Chauhan",
"phone_number": "7326628770",
"email": "[email protected]",
"role": "Admin"
},
{
"id": 2,
"first_name": "",
"last_name": "",
"phone_number": "7607846774",
"email": "",
"role": "Admin"
},
{
"id": 3,
"first_name": "Satish",
"last_name": "Shekhar",
"phone_number": "9148450813",
"email": "[email protected]",
"role": "Admin"
},
{
"id": 4,
"first_name": "Satiadasadsadsh",
"last_name": "Shadssdasekhar",
"phone_number": "9148450814",
"email": "[email protected]",
"role": "Admin"
},
{
"id": 5,
"first_name": "Satish",
"last_name": "Shekhar",
"phone_number": "9148450815",
"email": "[email protected]",
"role": "Admin"
},
{
"id": 6,
"first_name": "Satish",
"last_name": "Shekhar",
"phone_number": "9148450816",
"email": "[email protected]",
"role": "Admin"
},
{
"id": 8,
"first_name": "SatishczxSC",
"last_name": "ShekharcXxzc",
"phone_number": "9148450812",
"email": "[email protected]",
"role": "Regular"
},
{
"id": 10,
"first_name": "Rashmi",
"last_name": "Chauhan",
"phone_number": "7326628771",
"email": "[email protected]",
"role": "Regular"
},
{
"id": 11,
"first_name": "Satish",
"last_name": "Shekhar",
"phone_number": "9148450822",
"email": "[email protected]",
"role": "Regular"
},
{
"id": 12,
"first_name": "Satiadasadsadsh",
"last_name": "Shadssdasekhar",
"phone_number": "",
"email": "",
"role": "Regular"
}
]
}
- POST - http://127.0.0.1:8010/api/user/ (to create a team member).
- request
{
"first_name": "Satish",
"last_name": "Shekhar",
"phone_number": "9148450822",
"email": "[email protected]",
"role": 2
}
- response
{
"is_success": true,
"message": null,
"response_data": {
"id": 11,
"first_name": "Satish",
"last_name": "Shekhar",
"phone_number": "9148450822",
"email": "[email protected]",
"role": "Regular"
}
}
- PUT - http://127.0.0.1:8010/api/user/ (to update a team member).
- request
{
"id":9,
"first_name": "SatishczxSC",
"last_name": "ShekharcXxzc",
"phone_number": "9148450812"
}
- response
{
"is_success": true,
"message": [
"Member details updated!"
],
"response_data": {
"id": 9,
"first_name": "SatishczxSC",
"last_name": "ShekharcXxzc",
"phone_number": "9148450812"
}
}
- POST - http://127.0.0.1:8010/api/user_delete/6/ (to delete a team member).
response
{
"is_success": true,
"message": [
"Member Deleted!"
],
"response_data": null
}
- clone the project -
git clone https://github.com/Raj160907/instawork.git
- create and start a virtual environment -
virtualenv env -p python3
- Activate virtual environment -
source env/bin/activate
- Install the project dependencies: -
pip install -r requirements.txt
- create a mysql db and add the credentials to settings.py -
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db_name',
'USER': 'db_user',
'PASSWORD': 'db_password',
'HOST': 'localhost',
'PORT': '3306'
}
}
python manage.py makemigrations
python manage.py migrate
python manage.py runserver