Skip to content

5udu3r/assignment-

Repository files navigation

assignment

Build Status Build Status Build Status Build Status Build Status

Overview

blah blah blah

clone

git clone https://github.com/tokyodevs/-assignment-.git && cd -assignment-

install packages from pip (python3)

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt 

another version install pks brew

migrate

python manage.py makemigrations
python manage.py migrate

test

python manage.py test

usage

create super user

python manage.py createsuperuser

output:

Username: root
Error: That username is already taken.
Username: admin
Email address: [email protected]
Password: 
Password (again): 
The password is too similar to the username.
This password is too short. It must contain at least 8 characters.
This password is too common.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.

run

python manage.py runserver 0.0.0.0:9000

do a login and get jwt

curl -X "POST" "http://localhost:9000/api/token/" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "username": "admin",
  "password": "admin"
}'

get the access token from previous command and request a list

curl "http://localhost:9000/api/news" \
     -H 'Authorization: Bearer YOUR_JWT' \
     -H 'Content-Type: application/json; charset=utf-8'

do a search request

curl "http://localhost:9000/api/news?q=trump" \
     -H 'Authorization: Bearer YOUR_JWT' \
     -H 'Content-Type: application/json; charset=utf-8'

docs (swagger)

http://localhost:9000/

TODO

About

blah blah blah

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published