My solution to the interview coding assesmen on Kola-Simpu github repo
steps to run the django project contained in this repo
- clone repo (or download manually) and navigate to folder directory on any CLI
- on the CLI, run
pip install -r requirements.txt
to install project dependencies into current working environment - user must have a MySQL interfacer installed on OS (i used xampp)
- create a MySQL database, and adjust the DATABASE settings located in the core/settings.py file to fit the just created database name and host.
- on the CLI, run migrations , with command
python manage.py makemigrations
followed bypython manage.py migrate
- authentication purposes
python manage.py createsuperuser
- run
python manage.py loaddata data.json
to load the data.json into the database - run
python manage.py runserver
- make a post request with your superuser credentials
http post :8000/api/token/ username=YOUR USERNAME password= YOUR PASSWORD
and copy your "access" token (lasts for only about 5mins, after which you have to requestfor another or refresh the token) - pages with authentication requirements will require you to add your access tokens to the request header eg
http http://127.0.0.1:8000/api/ "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNTQ1MjI0MjAwLCJqdGkiOiJlMGQxZDY2MjE5ODc0ZTY3OWY0NjM0ZWU2NTQ2YTIwMCIsInVzZXJfaWQiOjF9.9eHat3CvRQYnb5EdcgYFzUyMobXzxlAVh_IAgqyvzCE"
- study core/urls.py for other app url nagivations