- python 3.6.1+
- virtualenv
- django-rest-knox(mega-secure)
- django-rest-framework-jwt(semi-secure)
- https://postgresapp.com/ and get the django server to communicate with the database to be hosted somewhere
cd scapi
virtualenv -p `which python3.6` ./env
source ./env/bin/activate
pip install -r py-requirements/base.txt
cd scapi
python manage.py migrate
Create a local superuser with say username admin
and password password123
for example
python manage.py createsuperuser
python manage.py runserver
browse to http://localhost:8000
curl -XPOST -H 'Accept: application/json; indent=4' -u <username>:<password> http://127.0.0.1:8000/api/auth/login/
{
"user": {
"username": "<username>",
"first_name": "",
"last_name": ""
},
"token": "d626c65781c4530c5e63d6da93a3e1b515a36948314ce4aad65162f4f89382d4"
}
curl -XPOST -H 'Authentication: Token <insert token allocated from /login endpoint>' http://127.0.0.1:8000/api/auth/logout/