blah blah blah
git clone https://github.com/tokyodevs/-assignment-.git && cd -assignment-
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py test
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.
python manage.py runserver 0.0.0.0:9000
curl -X "POST" "http://localhost:9000/api/token/" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"username": "admin",
"password": "admin"
}'
curl "http://localhost:9000/api/news" \
-H 'Authorization: Bearer YOUR_JWT' \
-H 'Content-Type: application/json; charset=utf-8'
curl "http://localhost:9000/api/news?q=trump" \
-H 'Authorization: Bearer YOUR_JWT' \
-H 'Content-Type: application/json; charset=utf-8'
http://localhost:9000/
-
another branch or maybe another tag for using background tasks or maybe celery
-
write to work/test like https://github.com/tokyodevs/simple_django/blob/master/lesgo.sh
-
use https://pypi.org/project/django3scaffold/ for no reason
-
do the task