API written in Django Framework.
In Terminal, enter the following commands
virtualenv venv
mkvirtualenv -p /usr/bin/python2.7 --no-site-packages venv
pip install -r requirements.txt
python2.7 manage.py makemigrations
python2.7 manage.py migrate
python 2.7 manage.py runserver
POST http://localhost:8000/register/
{
'email': "<email>"
'password': "<password>"
}
200
{
'Status': "Ok"
}
400
{
'Error':'User already exists'
}
400
{
'Error':'Please provide email/password'
}
POST http://localhost:8000/login/
{
'email': "<email>"
'password': "<password>"
}
200
{
'token': "..."
}
400
{
'Error':'Please provide email/password'
}
400
{
'Error':'Invalid credentials'
}
GET http://localhost:8000/verify_token/
{
'Authorization': "token <auth token>"
}
200
{
'Status': "ok"
}
401
{
'detail':'Authentication credentials were not provided.'
}
MIT