/phonebook

A demo application (REST APIs) built in Django and SQLite to manage a user's contacts and phone numbers

Primary LanguagePython

A demo application (REST APIs) built in Django and SQLite to manage a user's contacts and phone numbers
Tested Enviroment
Python 2.7
Python 3.4
Django 1.11
Django Rest Framework 3.6
SQLite3
Ubuntu 14.04
Switch to project root directory and run below command to install project dependencies
pip install -r requirements.txt
Switch to project root directory and run below command to run project using built-in server
python manage.py runserver
API Endpoints
       
Endpoint Desc Method Data Require Response
/users/ Register new user POST {"username": "Alex", "password": 123} username, password User Object
/contacts/ Get list of contacts for logged in user GET {} No data required List of all contacts
/contacts/ Add New Contact with or without phone numbers POST{"name": "Mike", "phone_numbers": [{"number": "+23018574741"}, {"number": "+23018574741"}] } name Contact object including phone number list
/contacts/{pk}/ Update existing contact PUT {"name": "New Contact name"} name Contact object including phone number list
/contacts/{pk}/ Delete existing contact DELETE {} No data required Empty response
/contacts/{pk}/phone_numbers/ Add phone number to existing contact POST {"phone_number": "+914545414524"} phone_number Phone number object
NOTE: To view/add/delete users/contacts/phonenumbers login to Admin panel /admin/ with admin/demo1234
Available Users for testing purposes
user: demo1
pass: demo1

user: demo2
pass: demo2
Validations
1. Validing all international phone numbers

2. One contact can have 0 or more phone numbers

3. More than one contact can have the same phone number (think household landlines)