Assuming you do not have any merge conflicts and have the latest pull request
- There has been a lot of model changes so delete your db.sqlite3 file.
- Under
teams/migrations
delete everything except the__init__.py
file. - Run
pipenv install
- Run
pipenv shell
- Run
./manage.py makemigrations
to create the models and fields for the database - Run
./manage.py migrate
to create the tables in the database - Run
./manage.py createsuperuser
to create a user. You must be a registered user in the database to create a quiz. - To run the server type
./manage.py runserver
- Go to
http://127.0.0.1:8000/admin
and login
- Go to
http://127.0.0.1:8000/api
to create a new Quiz. Remember you must be a logged in user.- At the bottom of the page click on
Raw Data
to input all of the quiz information. - Here is a sample quiz to input in the field:
{ "name": "Test 1", "randomize_team": false, "teams": [ {"name": "team 1"}, {"name": "team 2"}, {"name": "team 3"} ], "questions": [ { "question":"how many days are there in a week?", "answers": [ {"answer": 7, "is_correct": true}, {"answer": 8}, {"answer": 9}, {"answer": 10} ] }, { "question":"how many days are in a year?", "answers": [ {"answer": 366}, {"answer": 377}, {"answer": 365, "is_correct": true}, {"answer": 356} ] } ] }
- Press post and you should have your first quiz published!
- To better understand the fields please go to
teams/models.py
- At the bottom of the page click on
- Go to
http://127.0.0.1:8000/api/:id
if it is your first quiz theid
will be 1. So simply go tohttp://127.0.0.1:8000/api/1/
- Once again scroll to the bottom to the
Raw Data
section and alter any fields of your choosing and pressPUT
. The page should reload with the updated information.